blog.robotex.de

Ruby: The set union operator for arrays

I hereby promise, that i'll never forget the "Set Union" operator again.

The Ruby API says: Set Union—Returns a new array by joining this array with other_ary, removing duplicates.

   [ "a", "b", "c" ] | [ "c", "d", "a" ]
          #=> [ "a", "b", "c", "d" ]


Back