string
原生的包装对象之一
charAt 类似[0]
contact
‘a’.concat(‘b’, ‘c’) // “abc”
‘JavaScript’.slice(0, 4) // “Java”
substring()
toLowerCase()转成小写
toUpperCase()转成大写
‘Hello World’.toLowerCase()
// “hello world”
‘Hello World’.toUpperCase()
// “HELLO WORLD”
match
返回数组
search
repalce
split
模板字符串
``
模板字符串(template string)是增强版的字符串,用反引号(`)标识
模板字符串中嵌入变量,需要将变量名写在${}之中。
标签模板
alert`hello`
// 等同于
alert(['hello'])
String.raw()
不进行转义
includes startWith endsWith
includes