2017-04-14 139 views

回答

0

從他們wiki,您可以使用IntersectWith方法:

IEnumerable otherCollection = new[] { 1, 2, 5, 8, 1 }; 
IEnumerable anotherCollection = new[] { 10, 20, 50, 80, 10 }; 
collection.Should().IntersectWith(otherCollection); 

確保在集合對象正確實現IEquatable<T>接口(optionaly)和Equals方法(需要)。

相關問題