转自:http://www.cnblogs.com/cyberarmy/p/3505138.html

 

using System.Linq;
 
 
 
 
List<string> ListA = new List<string>();
List<string> ListB = new List<string>();
List<string> ListResult = new List<string>();
 
 
 
 
ListResult = ListA.Distinct().ToList();//去重
ListResult = ListA.Except(ListB).ToList();//差集
ListResult= ListA.Union(ListB).ToList();  //并集
ListResult = ListA.Intersect(ListB).ToList();//交集

 

相关文章:

  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
猜你喜欢
  • 2021-06-07
  • 2017-11-23
相关资源
相似解决方案