String Object

eSignal EFS 2

String Object

Top  Previous  Next

 

The String Object in Javascript

 

String Constructors

 

       var a = "This is a string";

       var b = new String("This is another string");

 

 

 

String Methods and Properties

 

 

charAt(index)

returns the character at index

charCodeAt(index)

returns the ASCII value of the character at index

indexOf(value, [startIndex] )

returns the index within this string of the first occurrence of value starting at the optional startIndex

length

returns the length of the string

lastIndexOf(value, [startIndex] )

returns the index within this string of the last occurrence of value searching backwards starting at the optional startIndex

split(separator, limit)

splits this string around the matches of separator

substr(startIndex, length)

returns a substring beginning at startIndex, extracting length characters.

substring(startIndex, endIndex)

returns a substring spanning from startIndex to endIndex

toLowerCase()

returns a lower-case representation of the string

toUpperCase()

returns a upper-case representation of the string