【发布时间】:2018-12-28 15:47:27
【问题描述】:
我有一个列表,并想从中创建一个新列表,但仅限于特定索引处的元素。
例如:
// Form a new list made of people at indices 1, 3, 5, 44.
List<People> newList = existingList.ElementsAt(1,3,5,44);
我不想在这个上重新发明轮子,有什么内置方法吗?
【问题讨论】:
-
索引在编译时是已知的还是动态的?
标签: c# .net collections