From: Karl von Laudermann Date: 2008-04-15T02:30:09+09:00 Subject: Re: noob 'why doesn't this work' question On Apr 14, 12:16 pm, Vincent Angeloni wrote: > > Ah, yes. I knew it was something simple. > I'll just sort countarray so that the highest index value is first, and > perhaps that will take care of the problem! > Thank you. Another approach would be: instead of deleting each item, put nil at each specified array index. Then, after you're done iterating, delete all the nils using Array#compact!, like so: sizeList = [0,1,2,3,4,5,6] countarray = [3,4,6] countarray.each {|x| sizeList[x] = nil} sizeList.compact!