Mid From PDF Collections C# Collections

What methods does the List<T> class provide to search for an element?

  • Contains(item)
  • IndexOf(item)
  • Find(predicate)
  • FindAll(predicate)
  • Exists(predicate)
  • BinarySearch(item) (for sorted lists)

Example:

bool hasItem = numbers.Contains(10);
int index = numbers.IndexOf(10);
var result = numbers.Find(x => x > 50);

More from C# Programming Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details