Ruby/String/matching operator
Материал из Wiki.crossplatform.ru
(Различия между версиями)
ViGOur (Обсуждение | вклад) м (1 версия) |
Текущая версия на 17:56, 13 сентября 2010
if a string contains any vowels:
puts "String has vowels" if "This is a test" =~ /[aeiou]/
=~ is a matching operator
puts "String contains no digits" unless "This is a test" =~ /[0?]/