这样就可以了:
xx=xx..replace(/(^\s*)|(\s*$)/g,"");
另:
去左空格
replace(/(^\s*)/g, "");
去右空格replace(/(\s*$)/g, "");

 

中文全角空格不可以

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-06-09
  • 2022-03-10
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案