Enumerable ExtensionsIndex OfT Method
Returns the index of the first element that matches the given predicate.
Definition
Namespace: SphinxConnector.FluentApi.Util
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
The index of the first matching element, or -1 if no element matches.
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
public static int IndexOf<T>(
this IEnumerable<T> enumerable,
Func<T, bool> predicate
)
VB
<ExtensionAttribute>
Public Shared Function IndexOf(Of T) (
enumerable As IEnumerable(Of T),
predicate As Func(Of T, Boolean)
) As IntegerParameters
- enumerable IEnumerableT
- The elements to check.
- predicate FuncT, Boolean
- A function to test each element for a condition.
Type Parameters
- T
- The type of the elements of enumerable.
Return Value
Int32The index of the first matching element, or -1 if no element matches.