JavaScript String : Object
Instance Methods
Returns a String of length 1 that contains the character at position pos. Another way to retrieve a character in a string is this[pos].
Example:
RunResults:
Returns the unicode value of the character at position pos. Use String.fromCharCode to generate a string from character code values.
Example:
RunResults:
Returns the first location of searchString in this starting the search from startingIndex. Returns -1 if searchString is not found.
Example:
RunResults:
Returns the location of searchString in this starting the search from startingIndex by searching backwards through the string. If startingIndex is not specified, the search starts from the end of the string. Returns -1 if searchString is not found.
Example:
RunResults:
Compares this to that. Returns a negative number if this would sort before that, 0 if this and that are equal, and a positive number if this would sort after that.
Example:
RunResults:
If regexp matches this, returns a new Array with item 0 equal to the portion of this that matched the regular expression, item 1 equal to the first capturing group in regexp, item 2 equal to the second capturing group in regexp, and so on. If regexp doesn't match this, returns null.
Example:
RunResults:
Returns a new String where the first occurence of searchValue in this is replaced with replaceValue.
Example:
RunResults:
Returns a new String where the first occurence of searchValue in this is replaced with the value returned from calling replaceFunction.
Example:
RunResults:
Returns a new String where searchValue matches in this is replaced with replaceValue. If searchValue is a global RegExp, each match in this will be replaced. Otherwise, just the first match will be replaced.
Example:
RunResults:
Returns a new String where searchValue matches in this is replaced with the value returned from calling replaceFunction. If searchValue is a global RegExp, each match in this will be replaced. Otherwise, just the first match will be replaced.
Example:
RunResults:
Executes regexp on this and returns the index of the first match. Returns -1 if regexp does not match this.
Example:
RunResults:
Returns a new string composed of the section of this between start and end-1. If endIndex is not specified, this.length is used instead. If startIndex or endIndex is negative, this.length is added to it before performing the substring.
Example:
RunResults:
Splits this at separator into an Array of Strings. If limit is specified, the returned array will contain no more than limit items.
Example:
RunResults:
Returns a new string composed of the section of this between start and end-1. Before performing the operation, substring may modifiy the effective values of start and end as follows. If both start and end are specified, and end is less than start, the values are swapped. If start is less than 0, it is replaced with 0. If end is negative, this.length is added to it before performing the substring. If end is not specified, this.length is used instead.
Example:
RunResults:
Returns a copy of this where each character is lower case.
Example:
RunResults:
Returns a copy of this where each character is upper case.
Example:
RunResults:
Returns a copy of this where each character is lower case.
Example:
RunResults:
String Methods
Returns a new string composed of characters from the specified unicode values. Use charCodeAt to retrieve character codes from strings.