Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

List<T>.BinarySearch Method

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Uses a binary search algorithm to locate a specific element in the sorted List<T> or a portion of it.

Namespace:   System.Collections.Generic
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodBinarySearch(T)

Searches the entire sorted List<T> for an element using the default comparer and returns the zero-based index of the element.

System_CAPS_pubmethodBinarySearch(T, IComparer<T>)

Searches the entire sorted List<T> for an element using the specified comparer and returns the zero-based index of the element.

System_CAPS_pubmethodBinarySearch(Int32, Int32, T, IComparer<T>)

Searches a range of elements in the sorted List<T> for an element using the specified comparer and returns the zero-based index of the element.

Return to top
Show:
© 2018 Microsoft