Module | ActiveSupport::CoreExtensions::String::StartsEndsWith |
In: |
vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb
|
Additional string tests.
Does the string end with the specified suffix?
# File vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb, line 13 13: def ends_with?(suffix) 14: suffix = suffix.to_s 15: self[-suffix.length, suffix.length] == suffix 16: end