I have a set of collections that look like this:
var arr1 = new string[] { "cat", "dog", "monkey", "chicken" };
var arr2 = new string[] { "chicken", "bird", "dog" };
var arr3 = new string[] { "dog", "camel", "chimp", "turtle", "chicken" };
var arr4 = new string[] { "dog", "chicken" };
var arr5 = new string[] { "camel", "dog", "chicken" };
And what I need to do is come up with some LINQ query to find all items common among all collections. Using the above data set, how would I derive this result:
var result = new string[] { "chicken", "dog" };
Since chicken and dog exists in all collections, they should be the only things in the resultant collection.
Doesn't have to be arrays, just any generic collection type.
This seems like a common query, so this post may be a duplicate... it's really hard to search for these types of queries since there are many derivatives.
Thank you