if a string contains any vowels: : matching operator « String « Ruby






if a string contains any vowels:


puts "String has vowels" if "This is a test" =~ /[aeiou]/

 

Related examples in the same category

1.=~ is a matching operator