NumberFormatInfo.NativeDigits NumberFormatInfo.NativeDigits NumberFormatInfo.NativeDigits NumberFormatInfo.NativeDigits Property

定義

西洋数字 0 ~ 9 に等しいネイティブ数字の文字列配列を取得または設定します。Gets or sets a string array of native digits equivalent to the Western digits 0 through 9.

public:
 property cli::array <System::String ^> ^ NativeDigits { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
[System.Runtime.InteropServices.ComVisible(false)]
public string[] NativeDigits { get; set; }
member this.NativeDigits : string[] with get, set
Public Property NativeDigits As String()

プロパティ値

String[]

西洋数字 0 ~ 9 に等しいネイティブ数字を含む文字列配列。A string array that contains the native equivalent of the Western digits 0 through 9. 既定値は "0"、"1"、"2"、"3"、"4"、"5"、"6"、"7"、"8"、"9" を要素に持つ配列です。The default is an array having the elements "0", "1", "2", "3", "4", "5", "6", "7", "8", and "9".

例外

現在の NumberFormatInfo オブジェクトは読み取り専用です。The current NumberFormatInfo object is read-only.

設定操作で値が null です。In a set operation, the value is null.

または-or- 設定操作で値配列の要素が null です。In a set operation, an element of the value array is null.

設定操作で値配列に 10 個の要素がありません。In a set operation, the value array does not contain 10 elements.

- または --or- 設定操作で、値配列の要素に単一の Char オブジェクトまたはサロゲート ペアを構成する一対の Char オブジェクトが含まれていません。In a set operation, an element of the value array does not contain either a single Char object or a pair of Char objects that comprise a surrogate pair.

または-or- 設定操作で、値配列の要素が Unicode 規格で定義された数字ではありません。In a set operation, an element of the value array is not a number digit as defined by the Unicode Standard. つまり、配列要素中の数字は Unicode Number, Decimal Digit (Nd) General Category 値を持ちません。That is, the digit in the array element does not have the Unicode Number, Decimal Digit (Nd) General Category value.

または-or- 設定操作で、値配列内の要素の数値は配列内の要素の位置に対応していません。In a set operation, the numeric value of an element in the value array does not correspond to the element's position in the array. つまり、配列の 1 番目であるインデックス 0 の要素の数値が 0 でなく、インデックス 1 の要素の数値が 1 でありません。That is, the element at index 0, which is the first element of the array, does not have a numeric value of 0, or the element at index 1 does not have a numeric value of 1.

次の例で、NativeDigitsプロパティ。The following example demonstrates the NativeDigits property.

// This example demonstrates the NativeDigits property.

using namespace System;
using namespace System::Globalization;
using namespace System::Threading;

int main()
{
    CultureInfo^ currentCI = Thread::CurrentThread->CurrentCulture;
    NumberFormatInfo^ nfi = currentCI->NumberFormat;
    array<String^>^ nativeDigitList = nfi->NativeDigits;

    Console::WriteLine("The native digits for the {0} culture are:",
        currentCI->Name);

    for each (String^ nativeDigit in nativeDigitList)
    {
        Console::Write("\"{0}\" ", nativeDigit);
    }

    Console::WriteLine();
}
/*
This code example produces the following results:

The native digits for the en-US culture are:
"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"

*/
// This example demonstrates the NativeDigits property.

using System;
using System.Globalization;
using System.Threading;

class Sample 
{
    public static void Main() 
    {
    CultureInfo currentCI = Thread.CurrentThread.CurrentCulture;
    NumberFormatInfo nfi = currentCI.NumberFormat;
    string[] nativeDigitList = nfi.NativeDigits;

    Console.WriteLine("The native digits for the {0} culture are:", currentCI.Name);
    foreach (string s in nativeDigitList)
        {
        Console.Write("\"{0}\" ", s);
        }
    Console.WriteLine();
    }
}
/*
This code example produces the following results:

The native digits for the en-US culture are:
"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"

*/
' This example demonstrates the NativeDigits property.

Imports System
Imports System.Globalization
Imports System.Threading

Class Sample
    Public Shared Sub Main() 
        Dim currentCI As CultureInfo = Thread.CurrentThread.CurrentCulture
        Dim nfi As NumberFormatInfo = currentCI.NumberFormat
        Dim nativeDigitList As String() = nfi.NativeDigits
        
        Console.WriteLine("The native digits for the {0} culture are:", currentCI.Name)
        Dim s As String
        For Each s In  nativeDigitList
            Console.Write("""{0}"" ", s)
        Next s
        Console.WriteLine()
    
    End Sub 'Main
End Class 'Sample

'This code example produces the following results:
'
'The native digits for the en-US culture are:
'"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
'

注釈

重要

指定されている文字セット、NativeDigitsプロパティは解析または書式設定操作に影響を与えません。The character set that is specified by the NativeDigits property has no effect on parsing or formatting operations. 基本ラテンの数字 0 のみ (u+0030) 9 から (u+0039) 書式設定または数値または日付と時刻の値を解析するときに使用されます。Only the Basic Latin digits 0 (U+0030) through 9 (U+0039) are used when formatting or parsing numeric values or date and time values.

適用対象

こちらもご覧ください