我想要一个国家的国籍。如果我输入英格兰,那么它将返回英格兰的国籍。我不知道cultureinfo是否帮助了我。
string country = "England";
输出应该是:英国
有人可以帮忙吗?
答案 0 :(得分:1)
//Init your dictonary as like this
Dictionary<string, string> countryNationality = new Dictionary<string, string>() { { "India", "Indian" }, { "England", "British" } };
// Now access the value like this
string nationality = countryNationality["England"];//will give you British
string anotherNationality = countryNationality["India"];//will give you British