Reputation: 1289
Here is the scenario
a = [1,2,3]
b = [2,5,6]
I would like to find out which elements of b
are not present in a
. I could use include?
to check which ones are. But I am looking for something entirely opposite here.
Upvotes: 1
Views: 178
Reputation: 160171
> a - b
=> [1, 3]
> b - a
=> [5, 6]
(I can't quite tell which way you want to go.)
Upvotes: 8