From: Stefano Crocco Date: 2008-10-11T22:37:40+09:00 Subject: Re: newbie q: stripping duplicates Alle Saturday 11 October 2008, pierodancona@gmail.com ha scritto: > This is certainly well known, but not to me. > > >> a = [{"aa"=>"bb"},{"aa"=>"bb"}] > > => [{"aa"=>"bb"}, {"aa"=>"bb"}] > > >> a.uniq > > => [{"aa"=>"bb"}, {"aa"=>"bb"}] > > Why? and, what should I use instead of .uniq > to remove the duplicate? > > Thank you > Piero It works for me (with ruby-1.8.7-p72): irb(main):005:0> a = [{"aa" => "bb"}, {"aa" => "bb"}] => [{"aa"=>"bb"}, {"aa"=>"bb"}] irb(main):006:0> a.uniq => [{"aa"=>"bb"}] Which version of ruby are you using? Stefano