语言

MemoryExtensions.IndexOfAnyInRange 方法

定义

搜索介于 lowInclusive 和 highInclusive非独占范围内任何值的第一个索引。

重载

名称 说明
IndexOfAnyInRange<T>(Span<T>, T, T)

搜索介于 lowInclusive 和 highInclusive非独占范围内任何值的第一个索引。

IndexOfAnyInRange<T>(ReadOnlySpan<T>, T, T)

搜索介于 lowInclusive 和 highInclusive非独占范围内任何值的第一个索引。

IndexOfAnyInRange<T>(Span<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

搜索介于 lowInclusive 和 highInclusive非独占范围内任何值的第一个索引。

public:
generic <typename T>
 where T : IComparable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAnyInRange(Span<T> span, T lowInclusive, T highInclusive);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>;
public static int IndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>;
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member IndexOfAnyInRange : Span<'T (requires 'T :> IComparable<'T>)> * 'T * 'T -> int (requires 'T :> IComparable<'T>)
static member IndexOfAnyInRange : Span<'T (requires 'T :> IComparable<'T>)> * 'T * 'T -> int (requires 'T :> IComparable<'T>)
<Extension()>
Public Function IndexOfAnyInRange(Of T As IComparable(Of T)) (span As Span(Of T), lowInclusive As T, highInclusive As T) As Integer

类型参数

T

范围和值的类型。

参数

span
Span<T>

要搜索的跨度。

lowInclusive
T

要搜索的范围的下限(含)。

highInclusive
T

要搜索的范围上限(含)。

返回

指定范围内第一次出现任何值的索引。 如果所有值都超出指定范围,则返回 -1。

特性

适用于

IndexOfAnyInRange<T>(ReadOnlySpan<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

搜索介于 lowInclusive 和 highInclusive非独占范围内任何值的第一个索引。

public:
generic <typename T>
 where T : IComparable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAnyInRange(ReadOnlySpan<T> span, T lowInclusive, T highInclusive);
public static int IndexOfAnyInRange<T>(this ReadOnlySpan<T> span, T lowInclusive, T highInclusive) where T : IComparable<T>;
static member IndexOfAnyInRange : ReadOnlySpan<'T (requires 'T :> IComparable<'T>)> * 'T * 'T -> int (requires 'T :> IComparable<'T>)
<Extension()>
Public Function IndexOfAnyInRange(Of T As IComparable(Of T)) (span As ReadOnlySpan(Of T), lowInclusive As T, highInclusive As T) As Integer

类型参数

T

范围和值的类型。

参数

span
ReadOnlySpan<T>

要搜索的跨度。

lowInclusive
T

要搜索的范围的下限(含)。

highInclusive
T

要搜索的范围上限(含)。

返回

指定范围内第一次出现任何值的索引。 如果所有值都超出指定范围,则返回 -1。

适用于