Created
June 21, 2014 16:57
-
-
Save st98/e1a5f9bd9a8f5d3ec466 to your computer and use it in GitHub Desktop.
CoffeeScript で String#ljust。
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
String::ljust = (len = @length, ch = ' ') -> | |
result = this | |
while result.length < len | |
result += ch | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment