Posted By

electblake on 04/16/10


Tagged

trim String extending stringprototype


Versions (?)

Extending String object to include the trim() function


 / Published in: JavaScript
 

URL: http://www.delphifaq.com/faq/f1031.shtml

  1. String.prototype.trim = function () {
  2. return this.replace(/^\s*/, "").replace(/\s*$/, "");
  3. }

Report this snippet  

You need to login to post a comment.