CultureInfo.IsNeutralCulture Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets a value indicating whether the current CultureInfo object represents a neutral culture.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Booleantrue if the current CultureInfo object represents a neutral culture; otherwise, false.
The following example determines which cultures using the Chinese language are neutral cultures.
using System; using System.Globalization; public class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { outputBlock.FontFamily = new System.Windows.Media.FontFamily("Courier New"); // Create an array of Chinese culture names. string[] cultureNames = { "zh-CN", "zh-Hans", "zh-Hant", "zh-HK", "zh-MO", "zh-SG", "zh-TW" }; // Determine if each culture is a neutral culture. foreach (string cultureName in cultureNames) { CultureInfo ci = new CultureInfo(cultureName); outputBlock.Text += String.Format("{0,-7} {1,-40}", ci.Name, ci.EnglishName); if (ci.IsNeutralCulture) outputBlock.Text += ": neutral" + "\n"; else outputBlock.Text += ": specific" + "\n"; } } } /* This example produces the following output. zh-CN Chinese (People's Republic of China) : specific zh-Hans Chinese : neutral zh-Hant Chinese : neutral zh-HK Chinese (Hong Kong S.A.R.) : specific zh-MO Chinese (Macao S.A.R.) : specific zh-SG Chinese (Singapore) : specific zh-TW Chinese (Taiwan) : specific */
Show: