def chomp(sep = $/) "ruby\n".chomp #=> "ruby" end
Returns a new string with the trailing newline removed.
Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
Raised by Encoding and String methods when the source encoding is incompatible with the target encoding.
Encoding
String