.index0f(str) :返回该字符在原 字符串中首次出现的位置
.subString (indexl, index2) :从index1截取.index2的位置,包前不包后
.charAt (index) : 返回该索引上的字符,能找到返回字符,找不到””
.last Index0f(str) :返回该字符在原字符串中最后次出现的位置
.endsWi th(str):用于判断字符串是否以指定的后缀结束返回值布尔
.startsWithO查看字符串是否以指定的子字符串开头。
.replace(oldText, newTest)sp1it("-. ) :将字符串分割成数组对象;
.search (str).返回该字符在元素串中出现的位置
.concat (stry)连接+拼接字符
.toLocaleLowerCase0;:转小写
.toLocaleUpperCaseO):转大写
.trim() : 去掉开头和结尾的格
.charCodeAt(index) :返回在指定的位置的宇符的Uinicode 编码。
.formCharCode():将Unicode编码转为字符
.includes():查找字符串中是否包含指定的字符串。返回boolean
string对象的属性
最新推荐文章于 2022-10-29 11:58:51 发布