当前位置:网站首页>JS string and array methods
JS string and array methods
2022-07-03 05:04:00 【The wind blows and birds fly in the crotch】
JS String method :
indexOf Look back before ( Commonly used lastIndexOf Look backwards
indexOf Has two functions
1. You can detect the position of elements in the array
2. You can detect whether there is this element in the array ( duplicate removal )
charAt understand str[1]
charCodeAt understand
slice Intercept
substr
substring
replace String substitution , It can only be replaced once
split Turn a string into an array Split
toUpperCase Convert to uppercase
toLowerCase Convert to lowercase
JS Array method :
reverse Flip
sort Sort
push Add... From the back
unshift Add... From the front
pop Delete... From the back
shift Remove... From the front
indexOf From front to back string index
lastIndexOf String index from back to front
join,toString Convert to string type , It is recommended to use join
concat Become
slice Intercept ( A large array is only a part of a fragment )
splice Delete
————————————————
Copyright notice : This paper is about CSDN Blogger 「 The wind blows and birds fly in the crotch 」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/m0_66477165/article/details/122608744
边栏推荐
- ZABBIX monitoring of lamp architecture (3): zabbix+mysql (to be continued)
- Based on RFC 3986 (unified resource descriptor (URI): general syntax)
- Interface frequency limit access
- 论文阅读_清华ERNIE
- Learning record of arouter principle
- [set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
- JS dynamic table creation
- leetcode452. Detonate the balloon with the minimum number of arrows
- String matching: find a substring in a string
- Promise
猜你喜欢

The principle is simple, but I don't know how to use it? Understand "contemporaneous group model" in one article

Review the old and know the new: Notes on Data Science

论文阅读_ICD编码_MSMN

Career planning of counter attacking College Students

Shallow and first code

Basic knowledge of reflection (detailed explanation)

The consumption of Internet of things users is only 76 cents, and the price has become the biggest obstacle to the promotion of 5g industrial interconnection

Handler understands the record

RT thread flow notes I startup, schedule, thread

Class loading mechanism (detailed explanation of the whole process)
随机推荐
Market status and development prospect prediction of global colorimetric cup cover industry in 2022
On typescript and grammar
Messy change of mouse style in win system
Basic knowledge of reflection (detailed explanation)
[research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
"Niuke brush Verilog" part II Verilog advanced challenge
[backtrader source code analysis 4] use Python to rewrite the first function of backtrader: time2num, which improves the efficiency by 2.2 times
移动端——uniapp开发记录(公共请求request封装)
Shell script -- condition judgment
Uipath practice (08) - selector
Hire cashier (differential constraint)
[USACO 2009 Dec S]Music Notes
[research materials] 2022q1 game preferred casual game distribution circular - Download attached
1107 social clusters (30 points)
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
Learning record of arouter principle
[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)
Prepare for 2022 and welcome the "golden three silver four". The "summary of Android intermediate and advanced interview questions in 2022" is fresh, so that your big factory interview can go smoothly
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
"Pthread.h" not found problem encountered in compiling GCC