标签:cep intersect array 交集 c# var except 集合 []
Intersect 交集,Except 差集,Union 并集
int[] oldArray = { 1, 2, 3, 4, 5 }; int[] newArray = { 2, 4, 5, 7, 8, 9 }; var jiaoJi = oldArray.Intersect(newArray).ToList();//2,4,5交集 var oldChaJi = oldArray.Except(newArray).ToList();//1,3差集 var newChaJi = newArray.Except(oldArray).ToList();//7,8,9差集 var bingJi = oldArray.Union(newArray).ToList();//1,2,3,4,5,7,8,9并集
标签:cep intersect array 交集 c# var except 集合 []
原文地址:http://www.cnblogs.com/evemen/p/6634978.html