CultureInfo.TextInfo プロパティとは?

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CultureInfo.TextInfo プロパティの意味・解説 

CultureInfo.TextInfo プロパティ

カルチャ関連付けられている書記体系を定義する TextInfo取得します。

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

TextInfo プロパティは、文字列カルチャ固有のキャスト情報を提供します。カルチャ考慮しないキャスト実行するには、InvariantCulture の TextInfo プロパティ使用します。

使用例使用

"スペイン語 - スペイン" の国際並べ替え順序用の CultureInfo と、従来の並べ替え順序用のもう 1 つCultureInfo作成するコードの例を次に示します。

Imports System
Imports System.Collections
Imports System.Globalization

Public Class SamplesCultureInfo

   Public Shared Sub Main()

      ' Creates and initializes the CultureInfo which uses the international
 sort.
      Dim myCIintl As New
 CultureInfo("es-ES", False)

      ' Creates and initializes the CultureInfo which uses the traditional
 sort.
      Dim myCItrad As New
 CultureInfo(&H40A, False)

      ' Displays the properties of each culture.
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "PROPERTY",
 "INTERNATIONAL", "TRADITIONAL")
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "CompareInfo",
 myCIintl.CompareInfo, myCItrad.CompareInfo)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "DisplayName",
 myCIintl.DisplayName, myCItrad.DisplayName)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "EnglishName",
 myCIintl.EnglishName, myCItrad.EnglishName)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "IsNeutralCulture",
 myCIintl.IsNeutralCulture, myCItrad.IsNeutralCulture)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "IsReadOnly",
 myCIintl.IsReadOnly, myCItrad.IsReadOnly)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "LCID",
 myCIintl.LCID, myCItrad.LCID)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "Name",
 myCIintl.Name, myCItrad.Name)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "NativeName",
 myCIintl.NativeName, myCItrad.NativeName)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "Parent",
 myCIintl.Parent, myCItrad.Parent)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "TextInfo",
 myCIintl.TextInfo, myCItrad.TextInfo)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "ThreeLetterISOLanguageName",
 myCIintl.ThreeLetterISOLanguageName, myCItrad.ThreeLetterISOLanguageName)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "ThreeLetterWindowsLanguageName",
 myCIintl.ThreeLetterWindowsLanguageName, myCItrad.ThreeLetterWindowsLanguageName)
      Console.WriteLine("{0,-33}{1,-25}{2,-25}", "TwoLetterISOLanguageName",
 myCIintl.TwoLetterISOLanguageName, myCItrad.TwoLetterISOLanguageName)
      Console.WriteLine()

      ' Compare two strings using myCIintl.
      Console.WriteLine("Comparing ""llegar""
 and ""lugar""")
      Console.WriteLine("   With myCIintl.CompareInfo.Compare:
 {0}", myCIintl.CompareInfo.Compare("llegar",
 "lugar"))
      Console.WriteLine("   With myCItrad.CompareInfo.Compare:
 {0}", myCItrad.CompareInfo.Compare("llegar",
 "lugar"))

   End Sub 'Main 

End Class 'SamplesCultureInfo


'This code produces the following output.
'
'PROPERTY                         INTERNATIONAL            TRADITIONAL
'CompareInfo                      CompareInfo - 3082       CompareInfo
 - 1034
'DisplayName                      Spanish (Spain)          Spanish (Spain)
'EnglishName                      Spanish (Spain)          Spanish (Spain)
'IsNeutralCulture                 False                    False
'IsReadOnly                       False                    False
'LCID                             3082                     1034
'Name                             es-ES                    es-ES
'NativeName                       español (España)       
  español (España)
'Parent                           es                       es
'TextInfo                         TextInfo - 3082          TextInfo
 - 1034
'ThreeLetterISOLanguageName       spa                      spa
'ThreeLetterWindowsLanguageName   ESN                      ESN
'TwoLetterISOLanguageName         es                       es
'
'Comparing "llegar" and "lugar"
'   With myCIintl.CompareInfo.Compare: -1
'   With myCItrad.CompareInfo.Compare: 1

using System;
using System.Collections;
using System.Globalization;


public class SamplesCultureInfo  {

   public static void Main()
  {

      // Creates and initializes the CultureInfo which uses the international
 sort.
      CultureInfo myCIintl = new CultureInfo( "es-ES",
 false );
      
      // Creates and initializes the CultureInfo which uses the traditional
 sort.
      CultureInfo myCItrad = new CultureInfo( 0x040A, false
 );

      // Displays the properties of each culture.
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "PROPERTY",
 "INTERNATIONAL", "TRADITIONAL" );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "CompareInfo",
 myCIintl.CompareInfo, myCItrad.CompareInfo );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "DisplayName",
 myCIintl.DisplayName, myCItrad.DisplayName );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "EnglishName",
 myCIintl.EnglishName, myCItrad.EnglishName );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "IsNeutralCulture",
 myCIintl.IsNeutralCulture, myCItrad.IsNeutralCulture );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "IsReadOnly",
 myCIintl.IsReadOnly, myCItrad.IsReadOnly );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "LCID", myCIintl.LCID,
 myCItrad.LCID );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "Name", myCIintl.Name,
 myCItrad.Name );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "NativeName",
 myCIintl.NativeName, myCItrad.NativeName );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "Parent", myCIintl.Parent,
 myCItrad.Parent );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "TextInfo",
 myCIintl.TextInfo, myCItrad.TextInfo );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "ThreeLetterISOLanguageName",
 myCIintl.ThreeLetterISOLanguageName, myCItrad.ThreeLetterISOLanguageName );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "ThreeLetterWindowsLanguageName",
 myCIintl.ThreeLetterWindowsLanguageName, myCItrad.ThreeLetterWindowsLanguageName
 );
      Console.WriteLine( "{0,-33}{1,-25}{2,-25}", "TwoLetterISOLanguageName",
 myCIintl.TwoLetterISOLanguageName, myCItrad.TwoLetterISOLanguageName );
      Console.WriteLine();

      // Compare two strings using myCIintl.
      Console.WriteLine( "Comparing \"llegar\" and \"lugar\""
 );
      Console.WriteLine( "   With myCIintl.CompareInfo.Compare: {0}", myCIintl.CompareInfo.Compare(
 "llegar", "lugar" ) );
      Console.WriteLine( "   With myCItrad.CompareInfo.Compare: {0}", myCItrad.CompareInfo.Compare(
 "llegar", "lugar" ) );

   }

}

/*
This code produces the following output.

PROPERTY                         INTERNATIONAL            TRADITIONAL
CompareInfo                      CompareInfo - 3082       CompareInfo - 1034
DisplayName                      Spanish (Spain)          Spanish (Spain)
EnglishName                      Spanish (Spain)          Spanish (Spain)
IsNeutralCulture                 False                    False
IsReadOnly                       False                    False
LCID                             3082                     1034
Name                             es-ES                    es-ES
NativeName                       español (España)         español
 (España)
Parent                           es                       es
TextInfo                         TextInfo - 3082          TextInfo - 1034
ThreeLetterISOLanguageName       spa                      spa
ThreeLetterWindowsLanguageName   ESN                      ESN
TwoLetterISOLanguageName         es                       es

Comparing "llegar" and "lugar"
   With myCIintl.CompareInfo.Compare: -1
   With myCItrad.CompareInfo.Compare: 1

*/
using namespace System;
using namespace System::Collections;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes the CultureInfo which uses the international
 sort.
   CultureInfo^ myCIintl = gcnew CultureInfo( "es-ES",false
 );
   
   // Creates and initializes the CultureInfo which uses the traditional
 sort.
   CultureInfo^ myCItrad = gcnew CultureInfo( 0x040A,false );
   
   // Displays the properties of each culture.
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "PROPERTY", "INTERNATIONAL",
 "TRADITIONAL" );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "CompareInfo",
 myCIintl->CompareInfo, myCItrad->CompareInfo );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "DisplayName",
 myCIintl->DisplayName, myCItrad->DisplayName );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "EnglishName",
 myCIintl->EnglishName, myCItrad->EnglishName );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "IsNeutralCulture",
 myCIintl->IsNeutralCulture, myCItrad->IsNeutralCulture );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "IsReadOnly",
 myCIintl->IsReadOnly, myCItrad->IsReadOnly );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "LCID", myCIintl->LCID,
 myCItrad->LCID );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "Name", myCIintl->Name,
 myCItrad->Name );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "NativeName",
 myCIintl->NativeName, myCItrad->NativeName );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "Parent", myCIintl->Parent,
 myCItrad->Parent );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "TextInfo", myCIintl->TextInfo,
 myCItrad->TextInfo );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "ThreeLetterISOLanguageName",
 myCIintl->ThreeLetterISOLanguageName, myCItrad->ThreeLetterISOLanguageName
 );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "ThreeLetterWindowsLanguageName",
 myCIintl->ThreeLetterWindowsLanguageName, myCItrad->ThreeLetterWindowsLanguageName
 );
   Console::WriteLine( "{0,-33}{1,-25}{2,-25}", "TwoLetterISOLanguageName",
 myCIintl->TwoLetterISOLanguageName, myCItrad->TwoLetterISOLanguageName );
   Console::WriteLine();
   
   // Compare two strings using myCIintl -> 
   Console::WriteLine( "Comparing \"llegar\" and \"lugar\""
 );
   Console::WriteLine( "   With myCIintl -> CompareInfo -> Compare: {0}",
 myCIintl->CompareInfo->Compare( "llegar", "lugar" ) );
   Console::WriteLine( "   With myCItrad -> CompareInfo -> Compare: {0}",
 myCItrad->CompareInfo->Compare( "llegar", "lugar" ) );
}

/*
This code produces the following output.

PROPERTY                         INTERNATIONAL            TRADITIONAL           
   
CompareInfo                      CompareInfo - 3082       CompareInfo - 1034    
   
DisplayName                      Spanish (Spain)          Spanish (Spain)       
   
EnglishName                      Spanish (Spain)          Spanish (Spain)       
   
IsNeutralCulture                 False                    False                 
   
IsReadOnly                       False                    False                 
   
LCID                             3082                     1034                  
   
Name                             es-ES                    es-ES                 
   
NativeName                       español (España)         español
 (España)         
Parent                           es                       es                    
   
TextInfo                         TextInfo - 3082          TextInfo - 1034       
   
ThreeLetterISOLanguageName       spa                      spa                   
   
ThreeLetterWindowsLanguageName   ESN                      ESN                   
   
TwoLetterISOLanguageName         es                       es                    
   

Comparing "llegar" and "lugar"
   With myCIintl -> CompareInfo -> Compare: -1
   With myCItrad -> CompareInfo -> Compare: 1

*/
import System.* ;
import System.Collections.* ;
import System.Globalization.* ;

public class SamplesCultureInfo
{  
     public static void
 main(String[] args)
    {
        // Creates and initializes the CultureInfo which uses the 
        // international sort.
        CultureInfo myCIintl =  new CultureInfo("es-ES",
 false);

        // Creates and initializes the CultureInfo which uses the 
        // traditional sort.
        CultureInfo myCItrad =  new CultureInfo(0x40A, false);

        // Displays the properties of each culture.
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "PROPERTY",
 
            "INTERNATIONAL", "TRADITIONAL");
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "CompareInfo",
 
            myCIintl.get_CompareInfo(), myCItrad.get_CompareInfo());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "DisplayName",
 
            myCIintl.get_DisplayName(), myCItrad.get_DisplayName());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "EnglishName",
 
            myCIintl.get_EnglishName(), myCItrad.get_EnglishName());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "IsNeutralCulture",
 
            System.Convert.ToString(myCIintl.get_IsNeutralCulture()), 
            System.Convert.ToString(myCItrad.get_IsNeutralCulture()));
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "IsReadOnly",
 
            System.Convert.ToString(myCIintl.get_IsReadOnly()), 
            System.Convert.ToString(myCItrad.get_IsReadOnly()));
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "LCID", 
            System.Convert.ToString(myCIintl.get_LCID()), 
            System.Convert.ToString(myCItrad.get_LCID()));
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "Name", 
            myCIintl.get_Name(), myCItrad.get_Name());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "NativeName",
 
            myCIintl.get_NativeName(), myCItrad.get_NativeName());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "Parent",
 
            myCIintl.get_Parent(), myCItrad.get_Parent());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "TextInfo"
,
            myCIintl.get_TextInfo(), myCItrad.get_TextInfo());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", 
            "ThreeLetterISOLanguageName", 
            myCIintl.get_ThreeLetterISOLanguageName(), 
            myCItrad.get_ThreeLetterISOLanguageName());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", 
            "ThreeLetterWindowsLanguageName", 
            myCIintl.get_ThreeLetterWindowsLanguageName(),
            myCItrad.get_ThreeLetterWindowsLanguageName());
        Console.WriteLine("{0,-33}{1,-25}{2,-25}", "TwoLetterISOLanguageName"
,
            myCIintl.get_TwoLetterISOLanguageName(), 
            myCItrad.get_TwoLetterISOLanguageName());
        Console.WriteLine();

        // Compare two strings using myCIintl.
        Console.WriteLine("Comparing \"llegar\" and \"lugar\"");
        Console.WriteLine("   With myCIintl.CompareInfo.Compare: {0}",
            System.Convert.ToString ( myCIintl.get_CompareInfo().Compare(
            "llegar", "lugar")));
        Console.WriteLine("   With myCItrad.CompareInfo.Compare: {0}",
 
            System.Convert.ToString ( myCItrad.get_CompareInfo().Compare(
            "llegar", "lugar")));
    } //main 
} //SamplesCultureInfo

/*
This code produces the following output.

PROPERTY                         INTERNATIONAL            TRADITIONAL
CompareInfo                      CompareInfo - 3082       CompareInfo - 1034
DisplayName                      Spanish (Spain)          Spanish (Spain)
EnglishName                      Spanish (Spain)          Spanish (Spain)
IsNeutralCulture                 False                    False
IsReadOnly                       False                    False
LCID                             3082                     1034
Name                             es-ES                    es-ES
NativeName                       espaol (Espaa)         espaol (Espaa)
Parent                           es                       es
TextInfo                         TextInfo - 3082          TextInfo - 1034
ThreeLetterISOLanguageName       spa                      spa
ThreeLetterWindowsLanguageName   ESN                      ESN
TwoLetterISOLanguageName         es                       es

Comparing "llegar" and "lugar"
   With myCIintl.CompareInfo.Compare: -1
   With myCItrad.CompareInfo.Compare: 1
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CultureInfo.TextInfo プロパティ」の関連用語

CultureInfo.TextInfo プロパティのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   
検索ランキング



CultureInfo.TextInfo プロパティのページの著作権
Weblio 辞書情報提供元は参加元一覧にて確認できます。

  
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2020 Microsoft.All rights reserved.

©2020 Weblio RSS