例子:
string[] arrRate = new string[] { "a", "b", "c", "d" };//A string[] arrTemp = new string[] { "c", "d", "e" };//B string[] arrUpd = arrRate.Intersect(arrTemp).ToArray();//相同的数据 (结果:c,d) string[] arrAdd = arrRate.Except(arrTemp).ToArray();//A中有B中没有的 (结果:a,b) string[] arrNew = arrTemp.Except(arrRate).ToArray();//B中有A中没有的 (结果:e)
转自:https://www.cnblogs.com/lengzhan/p/6225580.html