From: Thomas Greenwood Date: 2011-05-15T22:06:04+09:00 Subject: Re: Counting how many times the same elements occurs in an array? I'm sure your solutions are better than mine, what I ended up doing; xml_events = Array.new temp_array = Array.new [...] #extract xml data and assign it to the events array. [...] xml_events.each{|x| if temp_array.include?(x) == false temp_array << x puts "#{x} occurs #{xml_events.count(x)} times" end } A kludge but it does the job. Thanks for your help. -- Posted via http://www.ruby-forum.com/.