比较两个list中不同的值简单方法(小记)

来源:互联网 发布:计算机通信与网络答案 编辑:程序博客网 时间:2024/06/17 11:50
  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 in c)
            {
                Console.WriteLine(i);
            }
            Console.Read();