using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { List a1 = new List { "foo", "bar", "foo" }; List a2 = new List { "bar", "foo", "bar" }; IEnumerable inFirstOnly = a1.Except(a2); IEnumerable inSecondOnly = a2.Except(a1); bool allInBoth = !inFirstOnly.Any() && !inSecondOnly.Any(); Console.WriteLine("allInBoth: " + allInBoth); } }