Method: String#rjust
- Defined in:
- string.c
#rjust(integer, padstr = ' ') ⇒ String
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.
"hello".rjust(4) #=> "hello"
"hello".rjust(20) #=> " hello"
"hello".rjust(20, '1234') #=> "123412341234123hello"
4586 4587 4588 |
# File 'string.c', line 4586 static VALUE rb_str_rjust(argc, argv, str) int argc; |