Ruby 2.7.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Stringクラス > delete_prefix
delete_prefix(prefix) -> String
[permalink][rdoc]文字列の先頭から prefix を削除した文字列のコピーを返します。
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
[SEE_ALSO] String#delete_prefix!
[SEE_ALSO] String#delete_suffix
[SEE_ALSO] String#start_with?