String.rstrip!
Signature
string.rstrip! #=> string or nil
String.rstrip! is the in-place edit version ofString.rstrip.string.rstrip! returns string with trailing whitespace removed fromstring or it returns nil if no trailing whitespace was found.
Examples
str = "foo bar \r\n\t" #=> "foo bar \r\n\t"
str.rstrip! #=> "foo bar"
str == "foo bar \r\n\t" #=> false
str == "foo bar" #=> true
str.rstrip! #=> nil
Documentation Reference
- Log in to post comments
