зеркало из https://github.com/github/ruby.git
9 строки
340 B
Plaintext
9 строки
340 B
Plaintext
Returns a copy of +self+ with leading substring <tt>prefix</tt> removed:
|
|
|
|
'hello'.delete_prefix('hel') # => "lo"
|
|
'hello'.delete_prefix('llo') # => "hello"
|
|
'тест'.delete_prefix('те') # => "ст"
|
|
'こんにちは'.delete_prefix('こん') # => "にちは"
|
|
|
|
Related: String#delete_prefix!, String#delete_suffix.
|