1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/doc/string/delete_prefix.rdoc
Burdette Lamar b257034ae5
[DOC] Enhanced RDoc for String (#5730)
Treats:

    #start_with?
    #end_with?
    #delete_prefix
    #delete_prefix!
    #delete_suffix
    #delete_suffix!
2022-03-29 09:54:29 -05:00

8 lines
340 B
Text

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.