字符串以。结尾

要查找字符串是否以模式结尾,end_with? 方法会派上用场

str = "I like pineapples"
str.end_with?("pineaaples")      => false