比如list<a> 中有这样的几个数  1 2 3 4 5 
list<b> 中有这样的几个数      1 2 3 4 5 6 7
 怎样才能去除  6 和 7 
  在对比 两个List之后.netlistc#

解决方案 »

  1.   

    比如list<a> 中有这样的几个数  1 2 3 4 5 
     list<b> 中有这样的几个数      1 2 3 4 5 6 7
      怎样才能去取  6 和 7 
       在对比 两个List之后 
      我想要得到 6 和 7 
      

  2.   

     IList<int> aa = new List<int> { 1, 2, 3, 4, 5 };
                IList<int> bb = new List<int> { 1, 2, 3, 4, 5, 6, 7 };
                IList<int> cc = bb.Except(aa).ToList<int>();
      

  3.   

    本帖最后由 caozhy 于 2013-07-06 22:14:08 编辑