From: Daniel Finnie Date: 2008-05-08T03:47:42+09:00 Subject: Re: Check if char in string? ------=_Part_3784_29016165.1210186063137 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline The expression he gave uses the =~ operator, not the == operator. It will work if you try it in IRB (which I suggest you do before you post next time)... Dan On 5/7/08, globalrev wrote: > > On 7 Maj, 19:39, m...@tidbits.com (matt neuburg) wrote: > > globalrev wrote: > > > how do i do this: > > > > > str = "you muppet" > > > > > if "y" in str: > > > print "its in there" > > > > I always use regex in this situation: > > > > if str =~ /y/ > > > > m. > > > > -- > > matt neuburg, phd = m...@tidbits.com,http://www.tidbits.com/matt/ > > Leopard -http://www.takecontrolbooks.com/leopard-customizing.html > > AppleScript -http://www.amazon.com/gp/product/0596102119 > > Read TidBITS! It's free and smart.http://www.tidbits.com > > > > but none of that is what i want to do. > > i want to chekc if a char is in a string. > not check if a char equals another char. > > ------=_Part_3784_29016165.1210186063137--