Posted By

elightbo on 10/08/07


Tagged

String


Versions (?)

Trim() Function


 / Published in: JavaScript
 

URL: http://www.codestore.net/store.nsf/unid/BLOG-20060313

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

Report this snippet  

You need to login to post a comment.