Questions tagged «intersect»

8
相反的Intersect()
相交可用于查找两个集合之间的匹配项,如下所示: // Assign two arrays. int[] array1 = { 1, 2, 3 }; int[] array2 = { 2, 3, 4 }; // Call Intersect extension method. var intersect = array1.Intersect(array2); // Write intersection to screen. foreach (int value in intersect) { Console.WriteLine(value); // Output: 2, 3 } 但是我想要实现的却是相反的,我想列出一个集合中另一个集合中缺少的项目: // Assign …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.