js String方法集合
2024-09-28 20:23:14
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
//返回对应索引的字符
chartAt()
//返回对应所引的字符的统一码(Unicode value)
charCodeAt()
//Returns a non-negative integer that is the UTF-16 encoded code point value at the given position.
codePointAt();
//拼接两个字符串,并返回一个新的字符串
concat();
//Determines whether one string may be found within another string.
includes();
//Determines whether a string ends with the characters of another string.
endsWidth();
//返回一个字符串在另一个字符串中首次出现的位置,如果查找不到,返回-1
indexOf();
//返回一个字符串在另一个字符串中末次出现的位置,如果查找不到,返回-1
lastIndexOf();
//Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
localeCompare();
//用字符串匹配一个字符串
mach();
//Returns the Unicode Normalization Form of the calling string value.
normalize();
//Returns a string consisting of the elements of the object repeated the given times.
repeat();
//找出字符串中和正则表达式匹配的部分,并用一个新的子串替换
replace();
//找出字符串中和正则表达式匹配的部分
search();
//截取字符串的一部分返回
slice();
//把一个字符串分割成数组,分割点为传入的子串
split();
//Returns the characters in a string beginning at the specified location through the specified number of characters.
substr();
//
substring(); //
toLocalLowerCase(); // toLocalUpperCase(); toLowerCase();
toSource(); toString();
toUpperCase();
trim();
valueOf();
最新文章
- C#使用 DirectX SDK 9做视频播放器 并在视频画线添加文字 VMR9
- 基础算法之冒泡排序Bubble Sort
- 场景5 Performance Management
- 面试中遇到的iOS笔试题
- CDN——到底用还是不用?
- jquery 之ajax获取数据
- python Quicksort demo
- HttpClient_HttpClient 对 cookie的处理
- android:layout_gravity和android:gravity属性的区别
- CodeForces 378C Maze (DFS)
- 两个string数组对应比较
- USACO Section 1.3 Barn Repair 解题报告
- .net回复图片
- 运维ps语法---》ps、pstree、top、htop、nice、renice、kill、ulimit、w 和 who 和 whoami、pgrep、fg 和 bg、ipcs
- 20165234 《Java程序设计》第四周学习总结
- 11.vue 数据交互
- map在遍历数据的过程中删除数据不出错
- SAC处理命令transfer的一些详细介绍
- 使用Nginx代理Django
- (转)PXE+kickstart无人值守安装CentOS 7