delete_suffix(suffix) -> StringRuby 2.5.0 から[permalink][rdoc][edit]-
文字列の末尾から suffix を削除した文字列のコピーを返します。
- [PARAM]
suffix: - 末尾から削除する文字列を指定します。
- [RETURN]
- 文字列の末尾から suffix を削除した文字列のコピー
p "hello".delete_suffix("llo") # => "he" p "hello".delete_suffix("hel") # => "hello"[SEE_ALSO] String#chomp
[SEE_ALSO] String#chop
[SEE_ALSO] String#delete_prefix
[SEE_ALSO] String#delete_suffix!
[SEE_ALSO] String#end_with?
- [PARAM]