str.rjust(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 right
justified and padded with padstr; otherwise, returns str.
1 2 3 | "hello" .rjust( 4 ) #=> "hello" "hello" .rjust( 20 ) #=> " hello" "hello" .rjust( 20 , '1234' ) #=> "123412341234123hello" |
Please login to continue.