blob: 4862b725cfc64617a13bcd3c28c2f0a65fad2487 (
plain)
1
2
3
4
5
6
7
8
|
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.
|