var item = list.Where(t => somecondition);
I would love to be able to find out the index of the element that was returned, in fact, in my case all I want is an index, so that I can .Skip() into the list by that much.
Is there a way to do this in an IEnumerable? I’d hate to use a List<T> for this, but that does have a FindIndex() method
I’d need more context, but if you’re just getting an index so that you can call
.Skip, I would recommend taking a look at.SkipWhile.If you do really need the index, I’d suggest writing your own
.IndexOfextension method.