String.prototype.trim = function () {
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};
//written by Douglas Crockford
Showing posts with label Crockford. Show all posts
Showing posts with label Crockford. Show all posts
JavaScript trim()
Subscribe to:
Posts (Atom)