API Reference
Class
CountryLookup
Country/region helpers: map country to continent and resolve ISO codes from names. Mirrors functionality of the PowerShell helpers in a reusable .NET form.
Inheritance
- Object
- CountryLookup
Methods
public static String GetContinent(String country) #Returns:
StringReturns a continent for a given English country name; returns "Unknown" if not found.
Parameters
- country System.String
public static IReadOnlyDictionary<String, ValueTuple<CultureInfo, RegionInfo>> GetCultureLookup() #Returns:
IReadOnlyDictionary<String, ValueTuple<CultureInfo, RegionInfo>>Exposes the internal culture lookup table (name -> Culture, Region) for advanced use.
public static Boolean TryGetEnglishName(String countryCode, out String name) #Returns:
BooleanAttempts to resolve an English country name from a two/three-letter ISO code.
Parameters
- countryCode System.String
- name System.String@
public static Boolean TryGetTwoLetterIso(String country, out String code) #Returns:
BooleanAttempts to resolve a two-letter ISO country code from an English country name or alias.
Parameters
- country System.String
- code System.String@