Return to Snippet

Revision: 44797
at April 18, 2011 19:44 by ptiswitz


Initial Code
String.prototype.ltrim = function() {
	return this.replace(/^\s+/, '');
};
String.prototype.rtrim = function() {
	return this.replace(/\s+$/, '');
};

String.prototype.trim = function() {
	return this.ltrim().rtrim();
};

Initial URL

                                

Initial Description

                                

Initial Title
Add trim function to Javascript String Object

Initial Tags

                                

Initial Language
JavaScript