From: Nathan Olberding Date: 2006-04-06T01:44:14+09:00 Subject: Comparing Arrays I have two arrays: originalList and deleteList. I'm trying to iterate through original list and remove each item if it appears in the deleteList. Simple enough. Here's my snippet for doing this: originalList.each do |item| if deleteList.include?(item) puts "Deleting " + item originalList.delete(item) end end Unfortunately, this code doesn't seem to be doing what I think it should. It seems to skip some items in originalList. I can provide examples upon request. Is there anything wrong with my algorithm? -- Posted via http://www.ruby-forum.com/.