2010-06-02 20 views

cevap

26

Enumerable.Except

setB.Except(setA) 

Örnek:

HashSet<int> setB = new HashSet<int> { 1, 2, 3, 4, 5 }; 
HashSet<int> setA = new HashSet<int> { 1, 3, 5, 7 }; 
HashSet<int> result = new HashSet<int>(setB.Except(setA)); 

foreach (int x in result) 
    Console.WriteLine(x); 

Sonuç:

 
2 
4 
+0

çok teşekkürler !!! – SFun28