List<string> list1 = new List<string>() { "4ee","wf", "6yh", "gg", "wjjgf", "vvc" }; List<string> list2 = new List<string>() { "p4ee","wpf", "6yph", "gg", "wjppjgf", "vpvc" }; //首先 var tmp = list1.Concat(list2).ToList();//合并两个集合 //分组找到重复数据 var sameList = tmp.GroupBy(x => x) .Where(x => x.Count() > 1) .ToList(); //找到不重复数据 var uniqueList = tmp.GroupBy(x => x).ToList();
标签:tmp,ToList,两个,list1,List,list,list2,var,比较 From: https://www.cnblogs.com/Nicolasap/p/16724472.html