Created
September 23, 2013 17:08
-
-
Save mchambaud/6673730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!String.prototype.padLeft) { | |
String.prototype.padLeft = function (length, str) { | |
str = str || ' '; | |
return this.length >= length | |
? this | |
: (new Array(Math.ceil((length - this.length) / str.length) + 1).join(str)).substr(0, (length - this.length)) + this; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment