From: "David A. Black" Date: 2008-08-02T04:23:19+09:00 Subject: Re: Using array.select with grep Hi -- On Fri, 1 Aug 2008, Sebastian Hungerecker wrote: > David A. Black wrote: >> No, that's not the same. >> >>>> array = %w{ one two three } >> >> => ["one", "two", "three"] >> >>>> array.grep(/e/) >> >> => ["one", "three"] > > array.grep("e") > => [] > > So since the code in question only deals with strings and not regexen, using > include? does indeed have the same result as checking whether grep returned > an empty array. Right -- I un-stringed them by mistake. David -- Rails training from David A. Black and Ruby Power and Light: * Advancing With Rails August 18-21 Edison, NJ * Co-taught by D.A. Black and Erik Kastner See http://www.rubypal.com for details and updates!