JavaScript – String lastIndexOf() Method
The String lastIndexOf() method returns the position of the last occurrence, searching from the end to the beginning, of a specified value in a string.
The String lastIndexOf() method returns the position of the last occurrence, searching from the end to the beginning, of a specified value in a string.
The String localeCompare() method compares two strings in the current locale, and returns their sort order -1, 1, or 0 (before, after, equal).
The String match() method matches a string against a regular expression, returning an array with the matches or null if no match is found.
The String repeat() method returns a new string with a number of copies of an existing string, without changing the original string.
The String replace() method searches a string for a value or a regular expression, and returns a new string with the values replaced.
The String search() method matches a string against a regular expression, returning the position of the first match or -1 if no match is found.
The String slice() method extracts a part of a string, returning the extracted part as a new string, without changing the original string.
The String split() method splits a string into an array of substrings, and returns a new array, without changing the original string.
The String startsWith() method returns “true” if a string starts with a specified string, if not, it returns “false”.
The String substr() method extracts characters from a string starting at a specified position, returning the extracted part as a new string.
The String substring() method extracts characters from a string, between two positions, returning a substring, while not changing the original string.
The String toLocaleLowerCase() method converts a string to lowercase letters, using the current locale, without changing the original string.
The String toLocaleUpperCase() method converts a string to uppercase letters, using the current locale, without changing the original string.
The String toLowerCase() method converts a string to lowercase letters, without changing the original string.
The String toString() method returns a string object as a string, without changing the original string.
The String toUpperCase() method converts a string to uppercase letters, without changing the original string.
The String trim() method removes whitespace from both sides of a string, without changing the original string.
The String trimEnd() method removes whitespace from the end of a string, without changing the original string.
The String trimStart() method removes whitespace from the beginning of a string, without changing the original string.
The String valueOf() method returns the primitive value of a string, without changing the original string.