RegionInfo.NativeName Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the name of a country/region formatted in the native language of the country/region.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.StringThe native name of the country/region formatted in the language associated with the ISO 3166 country/region code.
Note: |
|---|
The NativeName property retrieves a localized region name if the RegionInfo object is constructed using a full culture name. |
Whenever possible, you should use the full culture name, such as "en-US", when instantiating a RegionInfo object, because the string returned by the NativeName property depends on the language associated with the country/region. For example, the cultures "en-US" and "es-US" on Windows Vista can retrieve different values. Therefore, creating the RegionInfo object with only a country/region name, such as "US" in this case, is not specific enough to distinguish the appropriate string.
The following code example demonstrates the NativeName property.
using System; using System.Globalization; class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { RegionInfo ri = new RegionInfo("sv-SE"); // Sweden outputBlock.Text += String.Format("Region English Name: . . . {0}", ri.EnglishName) + "\n"; outputBlock.Text += String.Format("Native Name: . . . . . . . {0}", ri.NativeName) + "\n"; outputBlock.Text += String.Format("Currency Symbol: . . . . . {0} ({1})", ri.CurrencySymbol, ri.ISOCurrencySymbol) + "\n"; } } /* This code example produces the following results: Region English Name: . . . Sweden Native Name: . . . . . . . Sverige Currency Native Name:. . . kr (SEK) */
Note: