Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Stringクラス > end_with?

instance method String#end_with?

end_with?(str) -> bool

self の末尾が str であるとき true を返します。

[PARAM] str:
パターンを表す文字列

例:

"string".end_with?("ing")   # => true
"string".end_with?("str")   # => false

[SEE_ALSO] String#start_with?

class String