NumberFormatInfo.NativeDigits Vlastnost
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Získá nebo nastaví pole řetězců nativních číslic odpovídající západním číslicám 0 až 9.
public:
property cli::array <System::String ^> ^ NativeDigits { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[] NativeDigits { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public string[] NativeDigits { get; set; }
member this.NativeDigits : string[] with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.NativeDigits : string[] with get, set
Public Property NativeDigits As String()
Hodnota vlastnosti
- String[]
Pole řetězců, které obsahuje nativní ekvivalent západních číslic 0 až 9. Výchozí hodnota je pole, které obsahuje prvky "0", "1", "2", "3", "4", "5", "6", "7", "8" a "9".
- Atributy
Výjimky
Aktuální objekt NumberFormatInfo je jen pro čtení.
V operaci set je hodnota null
.
-nebo-
V operaci set je prvek pole hodnot null
.
V operaci set pole hodnot neobsahuje 10 prvků.
-nebo- V operaci set neobsahuje prvek pole hodnot jeden objekt ani dvojici objektů, které tvoří Char Char náhradní pár.
-nebo-
V operaci set není prvek pole hodnot číselnou číslicí definovanou standardem Unicode. To znamená, že číslice v prvku pole nemá hodnotu obecné kategorie Unicode Number, Decimal Digit
(Nd).
-nebo- V operaci set číselná hodnota prvku v poli hodnot neodpovídá pozici prvku v poli. To znamená, že prvek na indexu 0, který je prvním prvkem pole, nemá číselnou hodnotu 0 nebo prvek na indexu 1 nemá číselnou hodnotu 1.
Příklady
Následující příklad ukazuje vlastnost NativeDigits .
// 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.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
End Class
'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"
'
Poznámky
Důležité
Znaková sada zadaná NativeDigits vlastností nemá žádný vliv na operace analýzy nebo formátování. Při formátování nebo analýze číselných hodnot nebo hodnot data a času se používají pouze číslice základní latinky 0 (U+0030) až 9 (U+0039).