I want to be able to get country code using country name. As of now I'm doing this:
var regions = CultureInfo.GetCultures(CultureTypes.SpecificCultures)
.Select(x => new RegionInfo(x.LCID));
var selectedRegion = regions.FirstOrDefault(region =>
region.EnglishName.Contains(countryName));
Where CountryName in my case is "Tanzania". It is not giving the country code even though in the regions it is present. It always returns null.
Can you please suggest/enlighten me on how to get this done.