Span<T>.Slice 方法

定義

多載

Slice(Int32)

從起始於指定索引的目前範圍形成配量。

Slice(Int32, Int32)

從起始於指定索引之指定長度的目前範圍形成配量。

Slice(Int32)

從起始於指定索引的目前範圍形成配量。

public:
 Span<T> Slice(int start);
public Span<T> Slice (int start);
member this.Slice : int -> Span<'T>
Public Function Slice (start As Integer) As Span(Of T)

參數

start
Int32

要開始配量的索引。

傳回

Span<T>

由從 start 到範圍結尾的目前範圍之所有項目組成的範圍。

例外狀況

start 小於零或大於 Length

適用於

Slice(Int32, Int32)

從起始於指定索引之指定長度的目前範圍形成配量。

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

參數

start
Int32

要開始此配量的索引。

length
Int32

配量所需的長度。

傳回

Span<T>

由起始於 start 目前範圍之 length 項目組成的範圍。

例外狀況

startstart + length 小於零或大於 Length

適用於