In a vb.net application I have a set of integers currently stored in multiple Arraylist (But this could be something different if required)
al1 = {1, 2, 3, 6, 7, 9}
al2 = {2, 3, 4, 9}
al3 = {2, 3, 19}
I would like to get the set {2, 3}
I thought about using LINQ to join the list, but the number of Arraylist can change. Im open to any ideas. I know I can always loop through everything and check if an integer exsist and keep track of it, but I thought there might be an easier way?
You can use the
Enumerable.Intersectmethod for this. And change yourArrayListto aList(Of T). That makes it easier to use LINQ methods.