 | EnumerableExtensionsIndexOfT Method |
Returns the index of the first element that matches the given predicate.
Namespace:
SphinxConnector.FluentApi.Util
Assembly:
SphinxConnector (in SphinxConnector.dll) Version: 5.4.1
Syntaxpublic static int IndexOf<T>(
this IEnumerable<T> enumerable,
Func<T, bool> predicate
)
<ExtensionAttribute>
Public Shared Function IndexOf(Of T) (
enumerable As IEnumerable(Of T),
predicate As Func(Of T, Boolean)
) As Integer
Parameters
- enumerable
- Type: System.Collections.GenericIEnumerableT
The elements to check. - predicate
- Type: SystemFuncT, Boolean
A function to test each element for a condition.
Type Parameters
- T
- The type of the elements of enumerable.
Return Value
Type:
Int32The index of the first matching element, or -1 if no element matches.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also