rjust(...)
public
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".rjust(20)
"hello".rjust(20, '1234')
Show source
/*
* call-seq:
* str.rjust(integer, padstr=' ') => new_str
*
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> right justified
* and padded with <i>padstr</i>; otherwise, returns <i>str</i>.
*
* "hello".rjust(4)
* "hello".rjust(20)
* "hello".rjust(20, '1234')
*/
static VALUE
rb_str_rjust(argc, argv, str)
int argc;
VALUE *argv;
VALUE str;
{
return rb_str_justify(argc, argv, str, 'r');
}