List<int> a = new List<int>() { 1, 2, 3, 6, 8, 7 };
List<int> b = new List<int>() { 1, 2, 3, 4, 5, 6 };
List<int> c = b.Except(a).ToList();
foreach (int i in c)
{
Console.WriteLine(i); //4 5
}
Console.Read();
时间: 2024-10-14 14:46:33
List<int> a = new List<int>() { 1, 2, 3, 6, 8, 7 };
List<int> b = new List<int>() { 1, 2, 3, 4, 5, 6 };
List<int> c = b.Except(a).ToList();
foreach (int i in c)
{
Console.WriteLine(i); //4 5
}
Console.Read();