Computer Science, asked by shrishtijaiswal7431, 1 year ago

How to find the index of an item in a C# list in a single step?

Answers

Answered by PriyanshuSakre
0

int index = myList.FindIndex(a => a.Prop == oProp);

This method performs a linear search; therefore, this method is an O(n) operation, where n is Count.

Similar questions