ruby/doc/string/end_with_p.rdoc
2025-07-31 09:13:20 -04:00

10 lines
379 B
Text

Returns whether +self+ ends with any of the given +strings+:
'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
Related: see {Querying}[rdoc-ref:String@Querying].