Skip to content
instance method

String#chomp!

(nil) -> nil
(?::string? separator) -> self?
chomp!(line_sep = $/) → self or nil

Like String#chomp, except that:

  • Removes trailing characters from self (not from a copy of self).

  • Returns self if any characters are removed, nil otherwise.

Related: see Modifying.

See also #chomp #chop #chars #chop! also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0