str.ljust(integer, padstr=' ') â new_str
Instance Public methods
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.
1 2 3 | "hello" .ljust( 4 ) #=> "hello" "hello" .ljust( 20 ) #=> "hello " "hello" .ljust( 20 , '1234' ) #=> "hello123412341234123" |
Please login to continue.