JS去除空格

来源:互联网 发布:硬盘恢复数据多少钱 编辑:程序博客网 时间:2024/04/29 06:12
String.prototype.Trim = function()   
  
return this.replace(/(^\s*)|(\s*$)/g, "");   
  
String.prototype.LTrim
 = function()   
  
return this.replace(/(^\s*)/g, "");   
  
String.prototype.RTrim
 = function()   
  
return this.replace(/(\s*$)/g, "");   
}
原创粉丝点击