From: "RubyTalk@..." Date: 2009-03-26T02:00:26+09:00 Subject: Re: delete from array while iterating [2,3,4,5,6].delete_if{|x| (x%2==0) && (puts x) } 2 4 6 On Wed, Mar 25, 2009 at 9:47 AM, Tarscher wrote: > Hi all, > > I want to delete an element from an array when it matches a condition. > But I first want to print something to the screen when a amùcth is > found. > > I know a.delete_if but can I somehow add that print to the screen next > to the condition? If not , is there an alternative way to delete from > an array while iterating? > > thanks > Stijn > >