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_suffix.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
341 B
Text

Returns a copy of +self+ with trailing substring <tt>suffix</tt> removed:
'hello'.delete_suffix('llo') # => "he"
'hello'.delete_suffix('hel') # => "hello"
'тест'.delete_suffix('ст') # => "те"
'こんにちは'.delete_suffix('ちは') # => "こんに"
Related: String#delete_suffix!, String#delete_prefix.