Table of Contents

Method Slice

Namespace
Zyl.ExSpans
Assembly
ExSpans.Core.dll

Slice(nint)

Forms a slice out of the given read-only Ex span, beginning at 'start' (从指定索引处开始的只读扩展跨度形成切片).

[FakeCLSCompliant(false)]
public ReadOnlyExSpan<T> Slice(nint start)

Parameters

start nint

The zero-based index at which to begin this slice (从零开始的切片索引).

Returns

ReadOnlyExSpan<T>

Returns the new read-only Ex span (返回新的只读扩展跨度).

Exceptions

ArgumentOutOfRangeException

Thrown when the specified start index is not in range (<0 or >Length).

Slice(nint, nint)

Forms a slice out of the given read-only Ex span, beginning at 'start', of given length (从指定长度的指定索引处开始的当前只读扩展跨度形成切片)

[FakeCLSCompliant(false)]
public ReadOnlyExSpan<T> Slice(nint start, nint length)

Parameters

start nint

The zero-based index at which to begin this slice (从零开始的切片索引).

length nint

The desired length for the slice (exclusive) (切片所需的长度).

Returns

ReadOnlyExSpan<T>

Returns the new read-only Ex span (返回新的只读扩展跨度).

Exceptions

ArgumentOutOfRangeException

Thrown when the specified start or end index is not in range (<0 or >Length).