Home > Article > Web Front-end > How to use JavaScript strings
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 expressionSearchtarget 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 moduleVue’s computed propertiesThe above is the detailed content of How to use JavaScript strings. For more information, please follow other related articles on the PHP Chinese website!