ReadOnlySpan<T>.Slice ReadOnlySpan<T>.Slice ReadOnlySpan<T>.Slice ReadOnlySpan<T>.Slice Method

Definition

Overloads

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

Forms a slice out of the current read-only span that begins at a specified index.

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

Forms a slice out of the current read-only span starting at a specified index for a specified length.

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

Forms a slice out of the current read-only span that begins at a specified index.

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

Parameters

start
Int32 Int32 Int32 Int32

The index at which to begin the slice.

Returns

A span that consists of all elements of the current span from start to the end of the span.

Exceptions

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

Forms a slice out of the current read-only span starting at a specified index for a specified length.

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

Parameters

start
Int32 Int32 Int32 Int32

The index at which to begin this slice.

length
Int32 Int32 Int32 Int32

The desired length for the slice.

Returns

A read-only span that consists of length elements from the current span starting at start.

Exceptions

Applies to