使用频率:高
-
- slice(start[, end]): 截取字符串。
-
- split(separator[, limit]): 分割字符串。
-
- concat(str1, str2, ..., strN): 连接多个字符串。
-
- indexOf(searchValue[, fromIndex]): 返回指定值的第一次出现的位置。
-
- lastIndexOf(searchValue[, fromIndex]): 返回指定值的最后一次出现的位置。
-
- substring(start[, end]): 截取字符串。
-
- match(regexp): 使用正则表达式匹配字符串。
-
- search(regexp): 搜索字符串。 使用频率:一般
-
- charAt(index): 返回指定位置的字符。
-
- charCodeAt(index): 返回指定位置的字符的Unicode编码。
-
- replace(searchValue, replaceValue): 替换字符串中的指定值。
-
- localeCompare(string): 比较两个字符串。
-
- toLocaleLowerCase(): 转换为小写。
-
- toLocaleUpperCase(): 转换为大写。
-
- toLowerCase(): 转换为小写。
-
- toUpperCase(): 转换为大写。
-
- trim(): 去除字符串两端的空白字符。
-
- trimEnd(): 去除字符串末尾的空白字符。
-
- trimStart(): 去除字符串开头的空白字符。
-
- startsWith(searchString[, position]): 检查字符串是否以指定的子字符串开头。
-
- endsWith(searchString[, position]): 检查字符串是否以指定的子字符串结尾。
-
- repeat(count): 重复字符串。
-
- padStart(targetLength[, fillString]): 在字符串的开始填充字符串。
-
- padEnd(targetLength[, fillString]): 在字符串的末尾填充字符串。