CultureInfo.IsNeutralCulture 속성
현재 CultureInfo가 중립 culture를 표시하는지 여부를 나타내는 값을 가져옵니다.
네임스페이스: System.Globalization
어셈블리: mscorlib(mscorlib.dll)
구문
‘선언
Public Overridable ReadOnly Property IsNeutralCulture As Boolean
‘사용 방법
Dim instance As CultureInfo
Dim value As Boolean
value = instance.IsNeutralCulture
public virtual bool IsNeutralCulture { get; }
public:
virtual property bool IsNeutralCulture {
bool get ();
}
/** @property */
public boolean get_IsNeutralCulture ()
public function get IsNeutralCulture () : boolean
속성 값
현재 CultureInfo가 중립 culture를 표시하면 true이고, 그렇지 않으면 false입니다.
설명
중립 culture는 언어만 표시하고 국가/지역은 표시하지 않는 culture이고, 특정 culture는 언어와 국가/지역을 모두 표시하는 culture입니다. 예를 들어, "fr"는 중립 culture이고 "fr-FR"는 특정 culture입니다. "zh-CHS"(중국어 간체)와 "zh-CHT"(중국어 번체)는 모두 중립 culture입니다.
이 속성에서 false를 반환하면 culture는 특정 culture 또는 불변 culture입니다.
예제
다음 코드 예제에서는 중국어를 사용하는 culture 중 어떤 culture가 중립 culture인지를 확인합니다.
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 (Macao S.A.R.) : specific
'zh-CHT Chinese (Traditional) : neutral
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 (Macao S.A.R.) : specific
zh-CHT Chinese (Traditional) : neutral
*/
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 = safe_cast<CultureInfo^>(enum0->Current);
if ( ci->TwoLetterISOLanguageName->Equals( "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 (Macao S.A.R.) : specific
zh-CHT Chinese (Traditional) : neutral
*/
import System.* ;
import System.Globalization.* ;
public class SamplesCultureInfo
{
public static void main(String[] args)
{
// Lists the cultures that use the Chinese language and determines if
// each is a neutral culture.
for(int iCtr=0;
iCtr < (CultureInfo.GetCultures(CultureTypes.AllCultures).length);
iCtr++) {
CultureInfo ci =
CultureInfo.GetCultures(CultureTypes.AllCultures)[iCtr];
if (ci.get_TwoLetterISOLanguageName().equalsIgnoreCase("zh")) {
Console.Write("{0,-6} {1,-40}", ci.get_Name(),
ci.get_EnglishName());
if (ci.get_IsNeutralCulture()) {
Console.WriteLine(": neutral");
}
else {
Console.WriteLine(": specific");
}
}
}
} //main
} //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
*/
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0, 1.0에서 지원
참고 항목
참조
CultureInfo 클래스
CultureInfo 멤버
System.Globalization 네임스페이스
CultureInfo.InvariantCulture 속성