develop wherever and whenever you want...
Docs > String Class Summary

String Class Summary

The String class is used to construct string objects and provides common operations on all strings.

number length 
Current length of the string (read only)

string String([value]) 
Create a string object. If value is supplied, the string is a textual representation of value.

string String.fromCharCode(number) 
Return a string with a single character represented by the Unicode value in number.

string charAt(index) 
Return a string with a single character in this string at a given index.

number charCodeAt(index) 
Return the Unicode value for the character at a given index in this string.

string concat(other) 
Return a string representing this string with other appended to it.

number indexOf(other[,start]) 
Return the first index where other is found. If start is not supplied, index of 0 is used to begin the search. -1 is returned if the string is not found.

number lastIndexOf(other[,start]) 
Return the last index where other is found. If start is not supplied, index of 0 is used to begin the search. -1 is returned if the string is not found.

string substring(start,end) 
Return substring of this string beginning at start and up to (but not including) end.

string toLowerCase() 
Return string representing lower case of this string.

string toUpperCase() 
Return string representing upper case of this string.

array match(pattern) 
Return an array of all matches within this string to a regular expression pattern. pattern can be a RegExp object or a string. If pattern is a string, a RegExp object is created with the patten and used.

number search(pattern) 
Search for regular expression pattern and return index where pattern is found. pattern can be a a RegExp object or a string. If pattern is a string, a RegExp object is created and used to match the pattern. If the pattern is not found, -1 is returned.

array split(separator[,limit]) 
Split the string into an array of strings as delimited by separator regular expression (RegExp) object. limit controls how many iterations are performed. The remainder of the string is appended to the returned array.

string replace(s,r) 
Return a string which replaces all occurances of s with r in the current string. s can be a RegExp object or a string. r is always the replacement string value.