|
//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, ""); }
//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, ""); } |
|