判断两个集合的包含关系

            List<ComponentType> A= new List<ComponentType>();
            List<ComponentType> B= new List<ComponentType>();
            ……
             if (A.All(t => B.Any(b => b == t)))
                result = true;

  集合A是集合B的子集(被包括或相同)

猜你喜欢

转载自www.cnblogs.com/dyfisgod/p/12144821.html