Posted By

kajinka13 on 02/03/12


Tagged

javascript js


Versions (?)

Add trim method to String class


 / Published in: JavaScript
 

Add trim method to String class

  1. String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

Report this snippet  

You need to login to post a comment.