Trim whitespace from a string in Javascript:
String.prototype.trim = function() { return this.replace(/^\s*/, "").replace(/\s*$/, ""); }
Added on Monday, June 15, 2009 at 11:07 pm in Code. Related posts about javascript. Permalink