Skip to main content
.NET Framework Class Library
Array..::.BinarySearch Method





Searches a one-dimensional sorted Array for a value, using a binary search algorithm.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List
 NameDescription
Public methodStatic memberBinarySearch<(Of <(T>)>)(array<T>[]()[], T)Searches an entire one-dimensional sorted Array for a specific element, using the IComparable<(Of <(T>)>) generic interface implemented by each element of the Array and by the specified object.
Public methodStatic memberBinarySearch(Array, Object)Searches an entire one-dimensional sorted Array for a specific element, using the IComparable interface implemented by each element of the Array and by the specified object.
Public methodStatic memberBinarySearch<(Of <(T>)>)(array<T>[]()[], T, IComparer<(Of <(T>)>))Searches an entire one-dimensional sorted Array for a value using the specified IComparer<(Of <(T>)>) generic interface.
Public methodStatic memberBinarySearch(Array, Object, IComparer)Searches an entire one-dimensional sorted Array for a value using the specified IComparer interface.
Public methodStatic memberBinarySearch<(Of <(T>)>)(array<T>[]()[], Int32, Int32, T)Searches a range of elements in a one-dimensional sorted Array for a value, using the IComparable<(Of <(T>)>) generic interface implemented by each element of the Array and by the specified value.
Public methodStatic memberBinarySearch(Array, Int32, Int32, Object)Searches a range of elements in a one-dimensional sorted Array for a value, using the IComparable interface implemented by each element of the Array and by the specified value.
Public methodStatic memberBinarySearch<(Of <(T>)>)(array<T>[]()[], Int32, Int32, T, IComparer<(Of <(T>)>))Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer<(Of <(T>)>) generic interface.
Public methodStatic memberBinarySearch(Array, Int32, Int32, Object, IComparer)Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer interface.
Top
Microsoft is conducting an online survey to understand your opinion of the MSDN Web site. If you choose to participate, the online survey will be presented to you when you leave the MSDN Web site.

Would you like to participate?