Home >Web Front-end >JS Tutorial >javascript String object_javascript skills

javascript String object_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:05:151013browse

String methods in Javascrīpt:
1. Change string case
string.toUpperCase();
string.toLowerCase();
2. String search
indexOf() method Used to determine whether a short string is in another long string. If it exists, the position index is returned; if it does not exist, the value -1 is returned.
Usage: long string.indexOf("short string")
3. Extract character copies and substrings
The charAt() method can extract a single character from the specified position in the string.
The substring() method can be used to extract a continuous string, and the starting and ending positions need to be provided (Note: The characters at the ending position are not included in the extracted substring.)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn