From: Phrogz Date: 2007-03-17T07:15:04+09:00 Subject: Re: Issues using array.delete within a loop of the same array On Mar 16, 2:42 pm, james.d.mast...@gmail.com wrote: > This is a simplified example for what I'm trying to do but gets the > point across: > > irb(main):001:0> a = [1,2,3,4,5] > => [1, 2, 3, 4, 5] > irb(main):002:0> a.each {|e| a.delete e} > => [2, 4] a = [1,2,3,4,5] (a.length-1).downto(0){ |i| a.delete_at( i ) } p a #=> []