Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CultureInfo.IsNeutralCulture Property

Gets a value indicating whether the current CultureInfo represents a neutral culture.

[Visual Basic]
Public Overridable ReadOnly Property IsNeutralCulture As Boolean
[C#]
public virtual bool IsNeutralCulture {get;}
[C++]
public: __property virtual bool get_IsNeutralCulture();
[JScript]
public function get IsNeutralCulture() : Boolean;

Property Value

true if the current CultureInfo represents a neutral culture; otherwise, false.

Remarks

A neutral culture is a culture that is associated with a language but not with a country/region. A specific culture is a culture that is associated with a language and a country/region. For example, "fr" is a neutral culture and "fr-FR" is a specific culture. Note that "zh-CHS" (Simplified Chinese) and "zh-CHT" (Traditional Chinese) are neutral cultures.

If this property returns false, the culture is either a specific culture or the invariant culture.

Example

[Visual Basic, C#, C++] The following code example determines which cultures using the Chinese language are neutral cultures.

[Visual Basic] 
Imports System
Imports System.Globalization

Public Class SamplesCultureInfo

   Public Shared Sub Main()

      ' Lists the cultures that use the Chinese language and determines if each is a neutral culture.
      Dim ci As CultureInfo
      For Each ci In  CultureInfo.GetCultures(CultureTypes.AllCultures)
         If ci.TwoLetterISOLanguageName = "zh" Then
            Console.Write("{0,-6} {1,-40}", ci.Name, ci.EnglishName)
            If ci.IsNeutralCulture Then
               Console.WriteLine(": neutral")
            Else
               Console.WriteLine(": specific")
            End If
         End If
      Next ci

   End Sub 'Main 

End Class 'SamplesCultureInfo


'This code produces the following output.
'
'zh-CHS Chinese (Simplified)                    : neutral
'zh-TW  Chinese (Taiwan)                        : specific
'zh-CN  Chinese (People's Republic of China)    : specific
'zh-HK  Chinese (Hong Kong S.A.R.)              : specific
'zh-SG  Chinese (Singapore)                     : specific
'zh-MO  Chinese (Macau S.A.R.)                  : specific
'zh-CHT Chinese (Traditional)                   : neutral


[C#] 
using System;
using System.Globalization;

public class SamplesCultureInfo  {

   public static void Main()  {

      // Lists the cultures that use the Chinese language and determines if each is a neutral culture.
      foreach ( CultureInfo ci in CultureInfo.GetCultures( CultureTypes.AllCultures ) )  {
         if ( ci.TwoLetterISOLanguageName == "zh" )  {
            Console.Write( "{0,-6} {1,-40}", ci.Name, ci.EnglishName );
            if ( ci.IsNeutralCulture )  {
               Console.WriteLine( ": neutral" );
            }
            else  {
               Console.WriteLine( ": specific" );
            }
         }
      }

   }

}


/*
This code produces the following output.

zh-CHS Chinese (Simplified)                    : neutral
zh-TW  Chinese (Taiwan)                        : specific
zh-CN  Chinese (People's Republic of China)    : specific
zh-HK  Chinese (Hong Kong S.A.R.)              : specific
zh-SG  Chinese (Singapore)                     : specific
zh-MO  Chinese (Macau S.A.R.)                  : specific
zh-CHT Chinese (Traditional)                   : neutral

*/

[C++] 
#using <mscorlib.dll>
using namespace System;
using namespace System::Globalization;

int main()  {

   // Lists the cultures that use the Chinese language and determines if each is a neutral culture.
   System::Collections::IEnumerator* enum0 = CultureInfo::GetCultures(CultureTypes::AllCultures)->GetEnumerator();
   while (enum0->MoveNext())
   {
      CultureInfo* ci = __try_cast<CultureInfo*>(enum0->Current);
      if ( ci->TwoLetterISOLanguageName->Equals( S"zh" ) )  {
         Console::Write( S"{0,-6} {1,-40}", ci->Name, ci->EnglishName );
         if ( ci->IsNeutralCulture )  {
            Console::WriteLine( S": neutral" );
         }
         else  {
            Console::WriteLine( S": specific" );
         }
      }
   }
}

/*
This code produces the following output.

zh-CHS Chinese (Simplified)                    : neutral
zh-TW  Chinese (Taiwan)                        : specific
zh-CN  Chinese (People's Republic of China)    : specific
zh-HK  Chinese (Hong Kong S.A.R.)              : specific
zh-SG  Chinese (Singapore)                     : specific
zh-MO  Chinese (Macau S.A.R.)                  : specific
zh-CHT Chinese (Traditional)                   : neutral

*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

CultureInfo Class | CultureInfo Members | System.Globalization Namespace | InvariantCulture

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft