String API Flashcards
string.match(regexp)
Used to retrieve the matches when matching a string against a regular expression.
string.indexOf(searchValue[, fromIndex])
Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex, returns -1 if the value is not found.
string.localeCompare(compareString)
Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
string.charAt(index)
Returns the specified character from a string.
Removes whitespace from the right end of the string.
string.trimRight()
Removes whitespace from the left end of the string.
string.trimLeft()
Returns the specified character from a string.
string.charAt(index)
Executes the search for a match between a regular expression and this String object.
string.search(regexp)
Used to retrieve the matches when matching a string against a regular expression.
string.match(regexp)
Returns the characters in a string beginning at the specified location through the specified number of characters.
string.substr(start[, length])
Combines the text of two or more strings and returns a new string.
string.concat(string2, string3[, …, stringN])
Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex, returns -1 if the value is not found.
string.indexOf(searchValue[, fromIndex])
string.lastIndexOf(searchValue[, fromIndex])
Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex.
string.substr(start[, length])
Returns the characters in a string beginning at the specified location through the specified number of characters.
string.search(regexp)
Executes the search for a match between a regular expression and this String object.