Browse files

Merge remote-tracking branch 'guybrush/trimLeftRight' into js-shim

  • Loading branch information...
2 parents 165a563 + 4279b7f commit 623096a8213caf683c41979b004b37dac1c1c44c @kriskowal kriskowal committed Aug 9, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 es5-shim.js
View
12 es5-shim.js
@@ -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.