var reg =/[\u4e00-\u9fa5]/g;
var str= " 阿达 adas 123132  一二三 ";
str= str.replace(/[ ]/g, "");//去空格
str= str.replace(reg, "");//去除中文

去两端空格

String.prototype.trim=function (){return this.replace(/(^/s*)|(/s*$)/g,'');}

 

相关文章:

  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-20
  • 2022-02-11
  • 2021-06-24
相关资源
相似解决方案