动态字符

属性

  • 长度:length()

方法

  1. 增
    • 拼接:concat()
    • 填充:padStart()/padEnd()
  2. 删
    • 去白:trim()/trimStart()/trimEnd()
  3. 改
    • 大小:toLowerCase()/toUpperCase()
    • 切片:slice(m,n)
  4. 查
    • 正则:
      1. match()
      2. search(regexp)
        • 返回匹配片段的索引,如果没有匹配,则返回-1
    • 分隔:split()
    • 首位:startWith()/endWith()