Use Intersect :
Produces many intersections of two sequences.
a.Intersect(b)
Usage example:
IList<string> a = new List<string> { "foo", "bar", "baz" }; IList<string> b = new List<string> { "baz", "bar", "qux" }; var stringsInBoth = a.Intersect(b); foreach (string s in stringsInBoth) { Console.WriteLine(s); }
Conclusion:
bar baz
source share