LINQ的Intersect方法

找到两个集合中交集部分:


source code:

 IEnumerable<int> a = new List<int>{
                { 3 }, { 5 }, { 7 }
            };

            IEnumerable<int> b = new List<int> {
                { 5 }, { 6 }, { 9 }
            };

            IEnumerable<int> result = a.Intersect(b);

            result.ForEach(delegate (int n)
            {
                Write(n);
            });
原文地址:https://www.cnblogs.com/insus/p/5374130.html