ListExtensionsIndexOfFirstT(IEnumerableT, FuncT, Boolean) Method |
Gets the index the of first item in list that fulfills the predicate predicate
Namespace: Altaxo.CollectionsAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static int IndexOfFirst<T>(
this IEnumerable<T> list,
Func<T, bool> predicate
)
Parameters
- list IEnumerableT
- The list.
- predicate FuncT, Boolean
- The predicate function. The first argument is the item. If the return value is true, the index of this item is returned.
Type Parameters
- T
- Type of items in the list
Return Value
Int32Index the of first item in
list that fulfills the predicate, or a value of -1 if no such item could be found.
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