method

rstrip

v2_4_6 - Show latest stable - Class: String
rstrip()
public

Returns a copy of str with trailing whitespace removed. See also String#lstrip and String#strip.

Refer to strip for the definition of whitespace.

"  hello  ".rstrip   #=> "  hello"
"hello".rstrip       #=> "hello"