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
The reason is simple: In HTML documents, multiple ...
1. Enable remote access to the docker server Log ...
XML is designed to describe, store, transmit and ...
Table of contents 1. Principle of animation funct...
Purpose: Under Linux, the server program may be d...
This article shares the installation and configur...
Table of contents Preface 1. What is scalability?...
Tomcat defines multiple ClassLoaders internally s...
Table of contents Preface 1. Props, $emit one-way...
1. Preparation before installation Check the data...
The find command is mainly used to find directori...
The scroll bar position is retained when scrollin...
MySQL database basic syntax DDL Operations Create...
In Linux, the commands cat, more, and less can al...
There are currently three ways to display the cen...