how to get an element of hashtable in c#
//creating a Hashtable using collection-initializer syntax
var cities = new Hashtable(){
{"UK", "London, Manchester, Birmingham"},
{"USA", "Chicago, New York, Washington"},
{"India", "Mumbai, New Delhi, Pune"}
};
string citiesOfUK = (string) cities["UK"]; //cast to string
string citiesOfUSA = (string) cities["USA"]; //cast to string
Console.WriteLine(citiesOfUK);
Console.WriteLine(citiesOfUSA);
cities["UK"] = "Liverpool, Bristol"; // update value of UK key
cities["USA"] = "Los Angeles, Boston"; // update value of USA key
if(!cities.ContainsKey("France")){
cities["France"] = "Paris";
}