微信扫一扫
1.js去掉字符串中的所有空格 str = str.replace(/\s/g, ‘’)
2.去掉字符串前后的空格 name = name.replace(/(^\s*)|(\s*$)/g, ‘’)
相关推荐