Syntax:
bool SortedList.Contains(object key);
Parameter(s):
- key: The key to locate in the SortedList object.
Return value:
It returns a boolean value, if the key is found within SortedList then it returns true, otherwise it returns false.
Exception(s):
- System.ArgumentNullException
- System.InvalidOperationException
-
Program:
The source code to check whether a SortedList object contains a specific key is given below. The given program is compiled and executed successfully.
Output: