To find if a string ends with a pattern, the end_with? method comes in handy
end_with?
str = "I like pineapples" str.end_with?("pineaaples") => false