RankedDictionaryTKey, TValueContainsKey Method |
Namespace: Kaos.Collections
public bool ContainsKey( TKey key )
Exception | Condition |
---|---|
ArgumentNullException | When key is null. |
// 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"]}"); }