/ Published in: JavaScript
Add trim method to String class
Expand |
Embed | Plain Text
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
You need to login to post a comment.
Add trim method to String class
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
You need to login to post a comment.