JavaScript去除空格的好方法 (javascript js String trim() )
参考地址:JavaScript去除空格的三种方法http://www.yaosansi.com/post/304.htmlString.prototype.trim = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}String.prototype.trimLeft = function() {return this.replace(/(^\s*)/g, "");}String.prototype.trimRight = function() {return this.replace(/(\s*$)/g, "");}
页:
[1]