Memory<T>.Slice Memory<T>.Slice Memory<T>.Slice Memory<T>.Slice Method

Definition

Overloads

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

Forms a slice out of the current memory 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 memory starting at a specified index for a specified length.

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

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

Parameters

startIndex
Index Index Index Index

Returns

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

Forms a slice out of the current memory that begins at a specified index.

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

Parameters

start
Int32 Int32 Int32 Int32

The index at which to begin the slice.

Returns

An object that contains all elements of the current instance from start to the end of the instance.

Exceptions

System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException

start is less than zero or greater than Length.

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

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

Parameters

Returns

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

Forms a slice out of the current memory starting at a specified index for a specified length.

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

Parameters

start
Int32 Int32 Int32 Int32

The index at which to begin the slice.

length
Int32 Int32 Int32 Int32

The number of elements to include in the slice.

Returns

An object that contains length elements from the current instance starting at start.

Exceptions

System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException System.ArgumentOutOfRangeExceptionException

start is less than zero or greater than Length.

-or-

length is greater than Length - start

Applies to