Table of Contents

Method LastIndexOfAnyInRange

Namespace
Zyl.ExSpans
Assembly
ExSpans.dll

LastIndexOfAnyInRange<T>(ExSpan<T>, T, T)

Searches for the last index of any value in the range between lowInclusive and highInclusive, inclusive.

public static nint LastIndexOfAnyInRange<T>(this ExSpan<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>

Parameters

span ExSpan<T>

The span to search.

lowInclusive T

A lower bound, inclusive, of the range for which to search.

highInclusive T

A upper bound, inclusive, of the range for which to search.

Returns

nint

The index in the span of the last occurrence of any value in the specified range. If all of the values are outside of the specified range, returns -1.

Type Parameters

T

The type of the span and values.

LastIndexOfAnyInRange<T>(ReadOnlyExSpan<T>, T, T)

Searches for the last index of any value in the range between lowInclusive and highInclusive, inclusive.

public static nint LastIndexOfAnyInRange<T>(this ReadOnlyExSpan<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>

Parameters

span ReadOnlyExSpan<T>

The span to search.

lowInclusive T

A lower bound, inclusive, of the range for which to search.

highInclusive T

A upper bound, inclusive, of the range for which to search.

Returns

nint

The index in the span of the last occurrence of any value in the specified range. If all of the values are outside of the specified range, returns -1.

Type Parameters

T

The type of the span and values.