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 →