MemorySlice<T>.AsSpan Method

Converts an array slice to a span.

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
C#
public Span<T> AsSpan(
	int length
)

Parameters

length  Int32
The number of elements in the array.

Return Value

Span<T>
A Span<T> that covers length elements in the array slice.

Implements

IStorageSlice<T>.AsSpan(Int32)

Remarks

When the Stride is greater than or equal to zero, the first element of the span is the element with index 0 in the slice.

When the Stride is less than zero, the first element of the span is the last element (with index length-1) in the slice.

See Also