Created
March 23, 2009 13:39
-
-
Save masak/83548 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
----------------------------------------------------------- String#ljust | |
str.ljust(integer, padstr=' ') => new_str | |
------------------------------------------------------------------------ | |
If _integer_ is greater than the length of _str_, returns a new | |
+String+ of length _integer_ with _str_ left justified and padded | |
with _padstr_; otherwise, returns _str_. | |
"hello".ljust(4) #=> "hello" | |
"hello".ljust(20) #=> "hello " | |
"hello".ljust(20, '1234') #=> "hello123412341234123" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment