Click or drag to resize

RankedDictionaryTKey, TValueContainsKey Method

Determines whether the dictionary contains the supplied key.

Namespace:  Kaos.Collections
Assembly:  KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax
Exceptions
ExceptionCondition
ArgumentNullExceptionWhen key is null.
Remarks
This is a O(log n) operation.
Examples
The below snippet is part of a larger example of the RankedDictionaryTKey, TValueclass.
C#
// ContainsKey can be used to test keys before inserting them.
if (! cc.ContainsKey ("GG"))
{
    cc.Add ("GG", "Guernsey");
    Console.WriteLine ($"Value added for key = 'GG': {cc["GG"]}");
}
See Also