String.prototype.trim = function(){ return this.replace(/(^[//s]*)|([//s]*$)/g, ""); } String.prototype.lTrim = function(){ return this.replace(/(^[//s]*)/g, ""); } String.prototype.rTrim = function(){ return this.replace(/([//s]*$)/g, ""); }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8805.html