当前位置:网站首页>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
边栏推荐
- Shell script -- condition judgment
- 1087 all roads lead to Rome (30 points)
- 【批处理DOS-CMD命令-汇总和小结】-CMD窗口的设置与操作命令-关闭cmd窗口、退出cmd环境(exit、exit /b、goto :eof)
- What is UUID
- Learn to use the idea breakpoint debugging tool
- [SQL injection point] location and judgment of the injection point
- Messy change of mouse style in win system
- How to connect the network: Chapter 1 CSDN creation punch in
- Kept hot standby and haproxy
- Market status and development prospect prediction of global colorimetric cup cover industry in 2022
猜你喜欢
"Niuke brush Verilog" part II Verilog advanced challenge
Interface frequency limit access
How to connect the network: Chapter 2 (Part 1): a life cycle of TCP connection | CSDN creation punch in
[research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
leetcode435. Non overlapping interval
Review the configuration of vscode to develop golang
Thesis reading_ Chinese medical model_ eHealth
Retirement plan fails, 64 year old programmer starts work again
2022-02-11 daily clock in: problem fine brush
The principle is simple, but I don't know how to use it? Understand "contemporaneous group model" in one article
随机推荐
移动端——uniapp开发记录(公共请求request封装)
雇佣收银员(差分约束)
[set theory] relation properties (reflexivity | reflexivity theorem | reflexivity | reflexivity theorem | example)
[set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)
第十九届浙江省 I. Barbecue
[research materials] annual report of China's pension market in 2021 - Download attached
What is UUID
I stepped on a foundation pit today
最大连续子段和(动态规划,递归,递推)
Keepalived热备与HAProxy
String matching: find a substring in a string
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
50 practical applications of R language (36) - data visualization from basic to advanced
Literature reading_ Research on the usefulness identification of tourism online comments based on semantic fusion of multimodal data (Chinese Literature)
1095 cars on campus (30 points)
SSM framework integration
JDBC database operation
Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
leetcode406. Rebuild the queue based on height
[backtrader source code analysis 4] use Python to rewrite the first function of backtrader: time2num, which improves the efficiency by 2.2 times