Strings are immutable. The string method does not change the content of the original string, but returns a new string.
charAt(): Returns the character at the specified position.
concat(): concatenates two string literals and returns a new string.
indexOf():indexOf() method returns the location where the specified value first appears in a string object.
match(): Use regular expressions to compare strings.
replace(): is used to directly compare regular expressions and strings, and then replace the matched substring with a new substring.
slice(): Extract a string area and return a new string.
split(): Split the string object into a string array by separating the string into a string.
substr(): Returns a substring in the string starting from the specified position to the specified length.
substring(): Returns a substring between two indexes of a string (or to the end of a string).
Unlike slice() and substr() methods, substring() does not accept negative parameters.
trim(): Delete whitespace characters at both ends of a string.
The above summary of common methods for JavaScript String objects is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.