【C#】List使用汇总
作者:互联网
(1)将List复制到另一个List
List<T>newList = oldList.GetRange(index, count);
(2)批量对List的某个字段赋值
listName.ForEach(a => a.b = false);
(3)截取List
dataList = dataList.GetRange(firstIndex, 10); //截取firstIndex开始往后十个元素
(4)List转换为数组
String[] str=list.ToArray();
标签:复制到,GetRange,C#,List,截取,汇总,dataList,firstIndex 来源: https://www.cnblogs.com/Mars-0603/p/15343533.html