[DOC] Tweaks for String#chop

This commit is contained in:
BurdetteLamar 2025-07-09 12:27:58 -05:00 committed by Peter Zhu
parent 54f28c1db9
commit 94e702b0ba

View file

@ -13,4 +13,7 @@ Otherwise removes the last character if it exists.
'こんにちは'.chop # => "こんにち"
''.chop # => ""
If you only need to remove the newline separator at the end of the string, String#chomp is a better alternative.
If you only need to remove the newline separator at the end of the string,
String#chomp is a better alternative.
Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String].