MemoryExtensions.IndexOfAnyInRange 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
搜尋介於 lowInclusive 和 highInclusive之間的任意值的第一個索引,包含 。
多載
| 名稱 | Description |
|---|---|
| IndexOfAnyInRange<T>(Span<T>, T, T) |
搜尋介於 |
| IndexOfAnyInRange<T>(ReadOnlySpan<T>, T, T) |
搜尋介於 |
IndexOfAnyInRange<T>(Span<T>, T, T)
搜尋介於 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)
搜尋介於 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。