Материал из Wiki.crossplatform.ru
(Различия между версиями)
Версия 17:10, 26 мая 2010
Checking for prefixes and suffixes: Ruby 1.9 and later
s = "hello"
s.start_with? "hell" # => true. Note singular "start" not "starts"
s.end_with? "bells" # => false