Revision: 7204
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 14, 2008 01:31 by donkeykong
Initial Code
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
return this.replace(/\s+$/,"");
}
Initial URL
Initial Description
sample: var text = " string content "; text = text.trim();
Initial Title
javascript string methods
Initial Tags
javascript
Initial Language
JavaScript