在开发过程中.数组和集合的处理是最让我们担心.一般会用for or foreach 来处理一些操作.这里介绍一些常用的集合跟数组的操作函数.
首先举例2个集合A,B.
List<int> listA = new List<int> {1,2,3,5,7,9};
List<int> listB = new List<int> {13,4,17,29,2};
listA.AddRange(listB ); 把集合A.B合并
List<int> Result = listA.Union(listB).ToList<int>(); //剔除重复项
List<int> Result = listA.C