//Javascript去掉字符串前后空格 String.prototype.Trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); } //Javascript去掉字符串左空格 String.prototype.Ltrim = function () { return this.replace(/(^\s*)/g, ""); } //Javascript去掉字符串右空格 String.prototype.Rtrimfunction = function () { return this.replace(/(\s*$)/g, ""); } //去掉首位逗號 onblur = 'this.value=this.value.toString().replace(/(^\,*)|(\,*$)/g,"")' |
|