def chomp(sep = $/) "ruby\n".chomp #=> "ruby" end
Returns a new string with the trailing newline removed.
End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →