From: Phrogz Date: 2007-03-17T07:10:06+09:00 Subject: Re: Issues using array.delete within a loop of the same array On Mar 16, 4:00 pm, james.d.mast...@gmail.com wrote: > On Mar 16, 2:01 pm, Timothy Hunter wrote: > > > Use #delete_if instead. > > Thanks - I tried that and it also did not work. Sorry for not posting > this attempt in my original: > > irb(main):001:0> a = [1,2,3,4,5] > => [1, 2, 3, 4, 5] > irb(main):002:0> a.each {|e| a.delete_if {|e2| e2 == e}} > => [2, 4] Kindly suggest that you RTFM by typing "ri Array#delete_if" into your console. :) If that doesn't make it clear, try this: a.delete_if{ true }