Posted By

gbot on 04/18/08


Tagged

trim String prototype


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gbot


string trim function


 / Published in: JavaScript
 

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

Report this snippet  

You need to login to post a comment.