(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();
2022-03-24 03:49:16
(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();