有没有Collections.disjoint()
(Java 语言)例如 .NET (C#) 的 API 或库?
来自 API 描述:
disjoint returns true if the two specified collections have no elements in common.
最佳答案
听起来您只是在寻找 LINQ Intersect
方法:
bool disjoint = !collection1.Intersect(collection2).Any();
关于c# - .Net 相当于 Java 'Collections.disjoint()' 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18267984/