From: Ashutosh Date: 2008-05-08T17:40:09+09:00 Subject: Re: Check if char in string? On May 8, 11:27 am, Jim Cochrane wrote: > On 2008-05-08, globalrev wrote: > > > this way: > > if str[x].chr =~ /[aeiouy]/ > > i can see if a char is any of the chars aeioyu > > > but i want to see if its not... > > if str[x].chr !=~ /[aeiouy]/ > > how about something like: > > if not str[x].chr =~ /[aeiouy]/ then print "YO\n" end > > OR > > if str[x].chr !~ /[aeiouy]/ then print "YO\n" end > > -- aa = "Hello World" if(aa.include?('o')) puts 'yes' end