js去掉空格

  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, ""); }
posted @ 2012-02-03 10:54  skillCoding  阅读(275)  评论(0)    收藏  举报