List of utility methods to do String Trim
trim()String.prototype.trim = function () { return this.replace(/^\s+|\s+$/, ""); }; | |
trim()'use strict'; String.prototype.trim = function(){ return /^\s*([\d\D]*?)\s*$/.exec(this)[1]; }; | |
trim()String.prototype.trim=function(){ return this.replace(/^\s+|\s+$/g,""); | |
trim()String.prototype.trim = function () { return this.replace(/^\s+/, ""); }; | |
trim()String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; | |
trim()String.prototype.trim = function () { return this.replace(/^\s+|\s+$/, ""); }; | |
trim()String.prototype.trim = function() return this.replace(/(^\s*)|(\s*$)/gi, ""); }; | |
trim()String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ''); | |
trim()String.prototype.trim = function() { return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,""); | |
trim()String.prototype.trim = function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }; |