Joel Pearson wrote in post #1121051:
> uniq can take a block as well if you wanted to unique similar arrays on
> a specific element:
>
> @mem.uniq { |mem| mem[1] }
>
> Or even on multiple criteria:
>
> @mem.uniq { |mem| [ mem[1], mem[2] ] }
This was very helpful
Thank you
--
Posted via http://
uniq can take a block as well if you wanted to unique similar arrays on
a specific element:
@mem.uniq { |mem| mem[1] }
Or even on multiple criteria:
@mem.uniq { |mem| [ mem[1], mem[2] ] }
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to th
if you really need to do some processing that gets you an array with
duplicate entries and then clean the array at the end of it all. try doing
something like
@mem = @mem.uniq
you can probably do @mem.uniq! but i've had some cases where that didn't
get me the results i wanted.
--
You recei
3 matches
Mail list logo