GenericExtensionsFindIndexT Method (IListT, PredicateT) |
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the list.
Namespace:
DHI.Mike1D.Generic
Assembly:
DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax public static int FindIndex<T>(
this IList<T> source,
Predicate<T> match
)
<ExtensionAttribute>
Public Shared Function FindIndex(Of T) (
source As IList(Of T),
match As Predicate(Of T)
) As Integer
public:
[ExtensionAttribute]
generic<typename T>
static int FindIndex(
IList<T>^ source,
Predicate<T>^ match
)
Parameters
- source
- Type: System.Collections.GenericIListT
IList to search - match
- Type: SystemPredicateT
The PredicateT delegate that defines the conditions of the element to search for.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:DHI.Mike1D.Generic.GenericExtensions.FindIndex``1(System.Collections.Generic.IList{``0},System.Predicate{``0})"]
Return Value
Type:
Int32The zero-based index of the first occurrence of an element that matches the conditions defined by
match, if found; otherwise, –1.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IListT. 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