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
Table of contents 1. What are microtasks? 2. What...
Preface The Boost library is a portable, source-c...
Detailed explanation of tinyMCE usage initializat...
This tutorial shares the specific code of MySQL5....
First, let’s understand what Docker is? Docker is...
Table of contents 1. Prepare data Create a data t...
Preface This article introduces a tutorial on how...
Preface I always thought that UTF-8 was a univers...
Table of contents Oracle Isolation Levels MySQL I...
JavaScript to achieve the source code download ad...
What is a Port? The ports we usually refer to are...
Table of contents Preface 1. Environment Configur...
<br />I am very happy to participate in this...
Preface The mv command is the abbreviation of mov...
1. Stop the MySQL service in the command line: ne...