1. trim()
它删除了两侧的空白。ECMAScript 2019 中还包含 trimStart() 和 trimStart() 方法。它们与 trim() 相同,但 trimStart() 和 trimEnd() 分别从字符串的开头和结尾删除空格。

2. match()
match() 方法返回匹配字符串的数组。

3. split()
split() 方法将字符串转换为字符串数组。

4. slice()
slice() 方法提取字符串的一部分并将其作为新字符串返回。 它有两个参数:起点和终点。 但是,如果你省略第二个,它将切断剩余的字符串。 在负值的情况下,参数的位置从字符串的末尾开始计算。

5. length
长度属性返回字符串的长度。

6. substr()
substr() 方法提取字符串的一部分并在新字符串中返回它。虽然它与 slice() 方法类似,但唯一的区别是该方法中的第二个参数指定了提取部分的长度。

7. search()
search() 方法在整个字符串中查找字符串,然后返回匹配的位置。

8. concat()
contact() 方法用于添加或连接两个或多个字符串。它也可以用来代替加号运算符。

9. charAt()
charAt() 方法返回字符串中指定索引处的字符。

10. repeat()
repeat() 方法将字符串重复指定的次数。

11. indexOf()
indexOf() 方法返回子字符串第一次出现的索引。

12. replace()
replace() 方法用字符串中的新值替换字符串。

13. includes()
includes() 方法检查字符串是否包含子字符串。如果字符串中包含指定值,则返回true;否则,它返回 false。

14. endsWith()
endsWith() 方法确定字符串是否以指定的值结束。如果答案是肯定的,则返回true;否则,它返回 false。

15. substring()
substring() 方法从字符串中提取字符串。它类似于 slice() 方法。不同之处在于,当起始值或结束值小于 0 时,函数将其视为 0。

16. startsWith()
startsWith() 检查字符串是否以指定值开头。

17. toLowerCase()
toLowerCase() 方法将字符串转换为小写。

18. toUpperCase()
toUpperCase() 方法将整个字符串大写。
