ArrayListBinarySearch Method (Object) |
Searches the entire sorted
ArrayList for an element using the default comparer and returns the zero-based index of the element.
Namespace: System.CollectionsAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual int BinarySearch(
Object value
)
Parameters
- value
- Type: SystemObject
The Object to locate. The value can be null.
Return Value
Type:
Int32The zero-based index of
value in the sorted
ArrayList, if
value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than
value or, if there is no larger element, the bitwise complement of
Count.
Exceptions See Also