Method: String#ljust
- Defined in:
- string.c
#ljust(integer, padstr = ' ') ⇒ String
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"
4563 4564 4565 |
# File 'string.c', line 4563 static VALUE rb_str_ljust(argc, argv, str) int argc; |