js 字符串去除空格

直接看代码

let str = '我的文件,    资料库,    ';
str = str.replace(/ /g,'')
console.log(str);  //'我的文件,资料库,';

猜你喜欢

转载自blog.csdn.net/weixin_45966674/article/details/124588912
今日推荐