Home  >  Article  >  Web Front-end  >  How to use JavaScript strings

How to use JavaScript strings

php中世界最好的语言
php中世界最好的语言Original
2018-03-19 16:27:181911browse

This time I will bring you String of JavaScript, how to use it, how to use JavaScript stringWhat are the precautions, the following is a practical case , let’s take a look.

charAt()             Get the character at a specific index in the string;

toupperCase() Convert all characters in the string to uppercase letters;

indexOf( ) Return to the position of the first appeared in the specific string in the strings

Sub String () Return to a skewers of a string

# Slice A substring of , supports negative parameters (the last character in the string is set to -1)

concat() is used to add multiple strings into one string

replace()          Replace a certain substring in the string with a specific string

split()                                                                                   ’s ’ s ’ s ’ s                   ‐ to ‐ ‐ ‐ ‐‐‐‐‐‐ ‐ ‐ ‐ 1 ) Use

regular expression

Searchtarget substringsearch()          Use regular expression to search for the target substring (the index is returned)

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Using Webpack module


Vue’s computed properties

The above is the detailed content of How to use JavaScript strings. For more information, please follow other related articles on the PHP Chinese website!

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