Several commonly used string methods in JavaScript String is a read-only data. Several commonly used string methods: 1. charAt: Get the corresponding character according to the specified subscript; 2. charCodeAt: Get the Asker code corresponding to the character according to the specified subscript; (there is an ASCII comparison table at the bottom) ps: Get the characters through the Ask code; 3. substring: intercept the string; 4. substr: intercept string; 5. slice: intercept the string; 6. indexOf: Find the first occurrence of a character/substring in a large string. If found, return the index. If not found, return -1. 7. lastIndexOf: Find the last occurrence of a character/substring in a large string 8. split: split a string into an array using the specified delimiter; 9. replace: replace a character/string in a string; 10. toupperCase is uppercase, tolowerCase is lowercase 11. trim: remove the blank characters on both sides of the string; ACSII comparison table: Summarize This concludes this article on the summary of several commonly used string methods in JavaScript. For more relevant JavaScript string method content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL 4G memory server configuration optimization
>>: How to build docker+jenkins+node.js automated deployment environment from scratch
Overview: The filesystem module is a simple wrapp...
Underlining in HTML used to be a matter of enclos...
0. Preparation: • Close iTunes • Kill the service...
<br />"There are no ugly women in the w...
Table of contents 1. Current situation 2. Communi...
The most significant website change in 2011 was Go...
1. Advantages and Disadvantages of Indexes Advant...
Detailed example of clearing tablespace fragmenta...
Error description: 1. After installing Nginx (1.1...
Follow the official tutorial, download the instal...
Table of contents 1. How to find duplicate rows 2...
one. Remote deployment using tomcat 1.1 Problems ...
Table of Contents Introduction Synchronous Asynch...
A must-have for interviews, you will definitely u...
How to allow remote connection in MySql To achiev...