Modifica

Condividi tramite


ReadOnlyMemory<T>.Slice Method

Definition

Overloads

Slice(Int32)

Forms a slice out of the given memory region, beginning at a specified position and continuing to its end.

Slice(Int32, Int32)

Forms a slice out of the given memory region starting at start position for length elements.

Slice(Int32)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Forms a slice out of the given memory region, beginning at a specified position and continuing to its end.

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

Parameters

start
Int32

The index at which to begin this slice.

Returns

A read-only memory region representing the desired slice.

Exceptions

start is less than 0 or greater than Length.

Applies to

Slice(Int32, Int32)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Forms a slice out of the given memory region starting at start position for length elements.

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

Parameters

start
Int32

The index at which to begin this slice.

length
Int32

The desired length for the slice.

Returns

A read-only memory region representing the desired slice.

Exceptions

start, length, or start + length are outside the range of the current instance.

Applies to