str = str.replace(/\s*/g,"");//去除所有空格
str = str.replace(/[^\u4e00-\u9fa5\w]/g,"");//去除符号
str = str.replace(/[_]/g,"");//去除下划线
正则表达式,去除空格标点下划线等
最新推荐文章于 2022-09-30 21:49:37 发布
str = str.replace(/\s*/g,"");//去除所有空格
str = str.replace(/[^\u4e00-\u9fa5\w]/g,"");//去除符号
str = str.replace(/[_]/g,"");//去除下划线