From: Emmanuel Touzery Date: 2002-12-03T23:55:19+09:00 Subject: Re: Conditional block operations Roman Rytov wrote: >Anotehr question is about COLLECT; > >myarray.collect {|x| x + ", "} > >I wanna execute only over specific emelents (let's say only odd ones or >all but last). > > what about: filteredArray = myarray.find_all { |x| (x%2==0) } filteredArray.collect... (see also Enumerable#reject) but that's still two lines. >Roman Rytov > > > emmanuel -- "If someone breaks into my house and steals my CDs, who calls the cops, me or the music industry? If it's me, then that's my property." --Ruben Safir