From: Paul Danese Date: 2008-04-16T00:25:04+09:00 Subject: Re: Match string from possible strings Also, using the facets gem you can turn "include?" around using "in?", which might have a more intuitive feel. require 'facets' >a = "Test" >arr = %w(Test Toast Tryst) >arrgh = %w(Toast Tryst) >a.in? arr =>true >a.in? arrgh =>false I saw a presentation on facets @ the Hartford rug a few weeks ago and I thoroughly enjoy this gem now. -----Original Message----- From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf Of John Butler Sent: Friday, April 11, 2008 8:44 AM To: ruby-talk ML Subject: Re: Match string from possible strings Park Heesob wrote: > Hi, > ----- Original Message ----- > From: "John Butler" > Newsgroups: comp.lang.ruby > To: "ruby-talk ML" > Sent: Friday, April 11, 2008 7:05 PM > Subject: Match string from possible strings > > >> route a >> else >> route b >> end >> >> Anyone know the quick way? >> >> JB > > Is this what you want? > > if [string1,string2,string3].include?("Test") > ... > > Regards, > Park Heesob Yes, This is what i have used, thanks JB -- Posted via http://www.ruby-forum.com/.