Stefano Crocco
10/11/2008 1:38:00 PM
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