gumpgit
10/30/2017 - 6:34 AM

C# 数组

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)



string[] arrNew = "a,b,c".Split(',') //[a,b,c]

string.Join(",", arrNew);   //"a,b,c"