There is a List<T>.FindIndex(Int32, Predicate <T>)
. That method is exactly what I want to for a IList<T>
object.
I know IList
has a method IndexOf(T)
but I need the predicate to define the comparing algorithm.
Is there a method, extension method, LINQ or some code to find the index of an item in a IList<T>
?
Where(...)
with something else the index is lost. – Shaeffer