SortedList<TKey, TValue>::IndexOfKey Method (TKey)
.NET Framework (current version)
Searches for the specified key and returns the zero-based index within the entire SortedList<TKey, TValue>.
Assembly: System (in System.dll)
Parameters
- key
-
Type:
TKey
The key to locate in the SortedList<TKey, TValue>.
Return Value
Type: System::Int32The zero-based index of key within the entire SortedList<TKey, TValue>, if found; otherwise, -1.
| Exception | Condition |
|---|---|
| ArgumentNullException | key is null. |
This method performs a binary search; therefore, this method is an O(log n) operation, where n is Count.
Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Available since 10
.NET Framework
Available since 2.0
Show: