contains Summary Checks if the specified key is in the dictionary. Usage public bool contains(string key) Returns A Boolean value representing whether the key is in the dictionary: true if the specified key is in the dictionary and false otherwise. Parameters key The key to check. Description Checks if the specified key is in the dictionary. This method returns true if the specified key is in the dictionary; otherwise, this method returns false. Examples Basic Usage 12345678import System; Dictionary<int> dict = { a: 1, b: 2, c: 3 };Console.log(dict.contains("a")); // trueConsole.log(dict.contains("b")); // trueConsole.log(dict.contains("c")); // trueConsole.log(dict.contains("d")); // falseConsole.log(dict.contains("z")); // false Share HTML | BBCode | Direct Link