Intersect 交集,Except 差集,Union 并集

int[] oldArray = { , , , ,  };
int[] newArray = { , , , , , };
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 并集
05-11 15:24