MemoryExtensions.IndexOfAnyExceptInRange Method

Definition

Overloads

IndexOfAnyExceptInRange<T>(ReadOnlySpan<T>, T, T)

Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.

IndexOfAnyExceptInRange<T>(Span<T>, T, T)

Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.

IndexOfAnyExceptInRange<T>(ReadOnlySpan<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.

public static int IndexOfAnyExceptInRange<T> (this ReadOnlySpan<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

lowInclusive
T

The lower bound, inclusive, of the excluded range.

highInclusive
T

The upper bound, inclusive, of the excluded range.

Returns

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

Applies to

.NET 9 and .NET 8
Product Versions
.NET 8, 9

IndexOfAnyExceptInRange<T>(Span<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.

public static int IndexOfAnyExceptInRange<T> (this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

lowInclusive
T

The lower bound, inclusive, of the excluded range.

highInclusive
T

The upper bound, inclusive, of the excluded range.

Returns

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

Applies to

.NET 9 and .NET 8
Product Versions
.NET 8, 9