一、startsWith()判断字符窜以什么开头,返会布尔值
let str="hello world"
let result=str.startsWith("hello")
console.log(result)//true
以什么结尾 endsWith()
let str="hello world"
let r2=str.endsWith("niao")
console.log(r2)//false
二、trim() 去除字符串前后的空格符
let str1=" hello world "//有空格
console.log(str.trim()=="hello world")//通过trim()去掉空格 true