Methods of strings in Javascript:
1. Change the upper and lower case of the string
();
();
2. String search
The indexOf() method is used to determine whether a short string is in another long string. If it exists, it returns the index of its location; if it does not exist, it returns the value -1.
Usage: long string.indexOf("short string")
3. Extract character copy and substring
The charAt() method can extract a single character from the specified position of the string.
The substring() method can be used to extract a continuous string, which requires the start and end positions (Note: the characters at the end position are not included in the extracted substring.)
1. Change the upper and lower case of the string
();
();
2. String search
The indexOf() method is used to determine whether a short string is in another long string. If it exists, it returns the index of its location; if it does not exist, it returns the value -1.
Usage: long string.indexOf("short string")
3. Extract character copy and substring
The charAt() method can extract a single character from the specified position of the string.
The substring() method can be used to extract a continuous string, which requires the start and end positions (Note: the characters at the end position are not included in the extracted substring.)