Span<T>.Slice Span<T>.Slice Span<T>.Slice Span<T>.Slice Method

定义

重载

Slice(Index) Slice(Index) Slice(Index) Slice(Index)
Slice(Int32) Slice(Int32) Slice(Int32) Slice(Int32)

从指定索引处开始的当前范围外形成切片。Forms a slice out of the current span that begins at a specified index.

Slice(Range) Slice(Range) Slice(Range)
Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

从指定长度的指定索引处开始,在当前范围外形成切片。Forms a slice out of the current span starting at a specified index for a specified length.

Slice(Index) Slice(Index) Slice(Index) Slice(Index)

public:
 Span<T> Slice(Index startIndex);
public Span<T> Slice (Index startIndex);
member this.Slice : Index -> Span<'T>
Public Function Slice (startIndex As Index) As Span(Of T)

参数

startIndex
Index Index Index Index

返回

Slice(Int32) Slice(Int32) Slice(Int32) Slice(Int32)

从指定索引处开始的当前范围外形成切片。Forms a slice out of the current span that begins at a specified index.

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 Int32 Int32 Int32

开始切片处的索引。The index at which to begin the slice.

返回

由当前范围(从 start 到范围末尾)的所有元素组成的范围。A span that consists of all elements of the current span from start to the end of the span.

异常

Slice(Range) Slice(Range) Slice(Range)

public:
 Span<T> Slice(Range range);
public Span<T> Slice (Range range);
member this.Slice : Range -> Span<'T>

参数

返回

Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

从指定长度的指定索引处开始,在当前范围外形成切片。Forms a slice out of the current span starting at a specified index for a specified length.

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 Int32 Int32 Int32

开始切片处的索引。The index at which to begin this slice.

length
Int32 Int32 Int32 Int32

切片所需的长度。The desired length for the slice.

返回

由当前范围(从 start 开始)中 length 元素组成的范围。A span that consists of length elements from the current span starting at start.

异常

startstart + length 小于零或大于 Lengthstart or start + length is less than zero or greater than Length.

适用于