正则表达式去 字符串空格
1.去掉左边空格.replace(/^\s*/g,"");
2.去掉右边空格.replace(/\s*$/g,"");
3.去掉前后空格.replace(/(^\s*)|(\s*$)/g,"")
4.去掉所有的空格.replace(/\s+/g,"")
1.去掉左边空格.replace(/^\s*/g,"");
2.去掉右边空格.replace(/\s*$/g,"");
3.去掉前后空格.replace(/(^\s*)|(\s*$)/g,"")
4.去掉所有的空格.replace(/\s+/g,"")