/ Published in: JavaScript
remove space at the front and the end.
Expand |
Embed | Plain Text
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); }
You need to login to post a comment.
kayue on 06/30/09
2 people have marked this snippet as a favorite
remove space at the front and the end.
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); }
You need to login to post a comment.