let str = " 清除首尾空格 ";
let str2 = str.replace(/^\s+|\s+$/g, "");
console.log(str);
console.log(str2+'123');
js正则---清除首尾空格
最新推荐文章于 2024-06-24 11:55:41 发布
let str = " 清除首尾空格 ";
let str2 = str.replace(/^\s+|\s+$/g, "");
console.log(str);
console.log(str2+'123');