diff --git a/doc/string/chomp.rdoc b/doc/string/chomp.rdoc index b6fb9ff38c..6ec7664f6b 100644 --- a/doc/string/chomp.rdoc +++ b/doc/string/chomp.rdoc @@ -25,5 +25,8 @@ removes multiple trailing occurrences of "\n" or "\r\n" When +line_sep+ is neither "\n" nor '', removes a single trailing line separator if there is one: - 'abcd'.chomp('d') # => "abc" - 'abcdd'.chomp('d') # => "abcd" + 'abcd'.chomp('cd') # => "ab" + 'abcdcd'.chomp('cd') # => "abcd" + 'abcd'.chomp('xx') # => "abcd" + +Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String].