From: Alex Fenton Date: 2008-11-11T09:42:38+09:00 Subject: Re: Comparing variable to multiple values Greg Lazarev wrote: > I'm wondering if there's a better way to do this in ruby: > > if a == "word1" || a == "word2" or || a == "word3" > puts "good" > end if ["word1", "word2", "word3"].include?(a) puts 'good' end OR case a when "word1", "word2", "word3" puts 'good' end hth a