Home > Web Front-end > JS Tutorial > body text

How to use JavaScript strings

php中世界最好的语言
Release: 2018-03-19 16:27:18
Original
1891 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!