Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What are the string methods in JS?
What are the string methods in JS?

concat() _ Concatenates two or more characters of text and returns a new string. \x0d\indexOf() _ \x0d\Returns the index of the first occurrence of a substring in the string. If there is no match, -1 is returned. \x0d\charAt() _ Returns the character at the specified position. \x0d\lastIndexOf() _ \x0d\Returns the index of the last occurrence of a substring in the string, or -1 if there is no match. \x0d\match() _ Checks whether a string matches a regular expression. \x0d\\x0d\substring() _ Returns a substring of a string. The incoming parameters are the starting position and the ending position. \x0d\replace() _ \x0d\ is used to find a string that matches a regular expression, and then replaces the matching string with a new string. \x0d\search() _ \x0d\Perform a regular expression match search. If the search is successful, the matching index value in the string is returned. Otherwise, -1 is returned. \x0d\slice() _ Extracts a portion of a string and returns a new string. \x0d\\x0d\split() _ Make a string into a string array by dividing the string into substrings. \x0d\length _ \x0d\ returns the length of the string. The so-called length of the string refers to the number of characters it contains. \x0d\toLowerCase() _ Convert the entire string to lowercase letters. \x0d\\x0d\toUpperCase() _ Convert the entire string to uppercase letters.