Method: String#rstrip!

Defined in:
string.c

#rstrip!self?

Removes trailing whitespace from str, returning nil if no change was made. See also String#lstrip! and String#strip!.

"  hello  ".rstrip   #=> "  hello"
"hello".rstrip!      #=> nil

Returns:

  • (self, nil)


4099
4100
4101
# File 'string.c', line 4099

static VALUE
rb_str_rstrip_bang(str)
VALUE str;