javascript去空格函数

来源:互联网 发布:4k网络电视哪个显示好 编辑:程序博客网 时间:2024/04/27 11:43
function   String.prototype.Trim()   {return   this.replace(/(^/s*)|(/s*$)/g,"");}  
function   String.prototype.Ltrim()  {return   this.replace(/(^/s*)/g,   "");}  
function   String.prototype.Rtrim()  {return   this.replace(/(/s*$)/g,   "");} 
原创粉丝点击