JavaScript字符串去除空格
/*字符串去除空格*/ String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.LeftTrim = function() { return this.replace(/(^\s*)/g, ""); } String.prototype.RightTrim = function() { return this.replace(/(\s*$)/g, ""); }