字符串的新方法 - trimStart(),trimEnd()
时间:2020-03-23 21:09:13
收藏:0
阅读:105
trimStart()
消除字符串头部的空格,trimEnd()
消除尾部的空格
const s = ‘ abc ‘; let a = s.trim() let b = s.trimStart() let c = s.trimEnd() console.log(a)// "abc" console.log(b) // "abc " console.log(c)// " abc"
原文:https://www.cnblogs.com/blogZhao/p/12554963.html
评论(0)