Skip to content

Instantly share code, notes, and snippets.

@rafaellyra
Created March 17, 2013 09:05

Revisions

  1. rafaellyra created this gist Mar 17, 2013.
    5 changes: 5 additions & 0 deletions trim.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    if (typeof String.prototype.trim !== 'function') {
    String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, '');
    }
    }