SpanExtensions.IndexOf<T>(Span<T>, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the index of an element of a given Span<T> from its reference.
public static int IndexOf<T> (this Span<T> span, ref T value);
static member IndexOf : Span<'T> * 'T -> int
<Extension()>
Public Function IndexOf(Of T) (span As Span(Of T), ByRef value As T) As Integer
Type Parameters
- T
The type if items in the input Span<T>.
Parameters
- value
- T
The reference to the target item to get the index for.
Returns
The index of value
within span
.
Exceptions
Thrown if value
does not belong to span
.