Actions
Bug #10582
closedString#chomp strips off more newlines than its documentation states
Description
Given an empty string as its parameter, String#chomp strips off as many trailing newlines as are present, plus a preceding carriage return if one exists:
irb(main):001:0> "foo\n\n\n".chomp
=> "foo\n\n"
irb(main):002:0> "foo\n\n\n".chomp ''
=> "foo"
irb(main):003:0> "foo\r\n\n\n".chomp ''
=> "foo"
This should either be mentioned as part of String#chomp's documentation, or removed.
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0