Skip to content

Commit

Permalink
Merge remote-tracking branch 'guybrush/trimLeftRight' into js-shim
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Aug 9, 2011
2 parents 165a563 + 4279b7f commit 623096a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions es5-shim.js
Expand Up @@ -874,4 +874,16 @@ if (!String.prototype.trim) {
};
}

if (!String.prototype.trimLeft) {
String.prototype.trimLeft = function(){
return this.replace(/^\s+/, '');
};
}

if (!String.prototype.trimRight) {
String.prototype.trimRight = function(){
return this.replace(/\s+$/, '');
};
}

});

0 comments on commit 623096a

Please sign in to comment.