当前位置: 代码迷 >> 综合 >> 去掉左右两边的空格
  详细解决方案

去掉左右两边的空格

热度:77   发布时间:2024-01-16 18:58:31.0
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "");
}
  相关解决方案