js清除字符串空格的简单方法

var sss = "  你好  "
sss.replace(/(^\s*)|(\s*$)/g, "");

这样即可清除

猜你喜欢

转载自blog.csdn.net/a864034462/article/details/131792725
今日推荐