/ 功能: 1)去除字符串前后所有空格 
// 2)去除字符串中所有空格(包括中间空格,需要设置第2个参数为:g) 
function Trim(str,is_global) 

var result; 
result = str.replace(/(^\s+)|(\s+$)/g,""); 
if(is_global.toLowerCase()=="g") 
result = result.replace(/\s/g,""); 
return result; 

 
 

相关文章:

  • 2021-12-29
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2022-03-01
  • 2022-03-06
  • 2021-07-09
相关资源
相似解决方案