語言

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>有效元素範圍。

適用於