You can use the JavaScript "cahrAt(index)" method, the "split([ separator][, limit])" method, or the "substring( indexA, indexB)" method. All of these methods are ECMA version 2.62 compliant.
A sample script that can be run in the JavaScript console:
var myString = "ABCD is a test string"; var firstLetter = myString.charAt(0); console.println("charAt(0) = " + firstLetter); firstLetter = myString.split('',1); console.println("split('',1) = " + firstLetter); firstLetter = myString.substring(0,1); console.println("substring(0,1) = " + firstLetter);
If you wanted to write your own LEFT funciton use the "substring()" method.
A sample script that can be run in the JavaScript console:
var myString = "ABCD is a test string";
var firstLetter = myString.charAt(0);
console.println("charAt(0) = " + firstLetter);
firstLetter = myString.split('',1);
console.println("split('',1) = " + firstLetter);
firstLetter = myString.substring(0,1);
console.println("substring(0,1) = " + firstLetter);
If you wanted to write your own LEFT funciton use the "substring()" method.
George Kaiser