mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOc] Tweaks for String#end_with?
This commit is contained in:
parent
e2bd36388f
commit
ff6a8e95b7
1 changed files with 8 additions and 9 deletions
|
@ -1,11 +1,10 @@
|
|||
Returns whether +self+ ends with any of the given +strings+.
|
||||
Returns whether +self+ ends with any of the given +strings+:
|
||||
|
||||
Returns +true+ if any given string matches the end, +false+ otherwise:
|
||||
'foo'.end_with?('oo') # => true
|
||||
'foo'.end_with?('bar', 'oo') # => true
|
||||
'foo'.end_with?('bar', 'baz') # => false
|
||||
'foo'.end_with?('') # => true
|
||||
'тест'.end_with?('т') # => true
|
||||
'こんにちは'.end_with?('は') # => true
|
||||
|
||||
'hello'.end_with?('ello') #=> true
|
||||
'hello'.end_with?('heaven', 'ello') #=> true
|
||||
'hello'.end_with?('heaven', 'paradise') #=> false
|
||||
'тест'.end_with?('т') # => true
|
||||
'こんにちは'.end_with?('は') # => true
|
||||
|
||||
Related: String#start_with?.
|
||||
Related: see {Querying}[rdoc-ref:String@Querying].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue