语言

List<T>.Slice(Int32, Int32) 方法

定义

在源 List<T>中创建一系列元素的浅表副本。

public:
 System::Collections::Generic::List<T> ^ Slice(int start, int length);
public System.Collections.Generic.List<T> Slice(int start, int length);
member this.Slice : int * int -> System.Collections.Generic.List<'T>
Public Function Slice (start As Integer, length As Integer) As List(Of T)

参数

start
Int32

范围从零 List<T> 开始的索引。

length
Int32

范围的长度。

返回

源 List<T>中元素范围的浅表副本。

例外

start 小于 0。

-或-

length 小于 0。

start 并且 length 不表示中 List<T>有效元素的范围。

适用于