mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for String#chop
This commit is contained in:
parent
54f28c1db9
commit
94e702b0ba
1 changed files with 4 additions and 1 deletions
|
@ -13,4 +13,7 @@ Otherwise removes the last character if it exists.
|
||||||
'こんにちは'.chop # => "こんにち"
|
'こんにちは'.chop # => "こんにち"
|
||||||
''.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].
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue