Int16.Parse Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Konvertiert die Zeichenfolgendarstellung einer Zahl in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
Überlädt
Parse(String, NumberStyles, IFormatProvider) |
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen Stil und einem kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen. |
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
Konvertiert die Spannendarstellung einer Zahl in einem angegebenen Stil und einem kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen. |
Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
Analysiert eine Spanne von UTF-8-Zeichen in einen Wert. |
Parse(String, IFormatProvider) |
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen. |
Parse(String) |
Konvertiert die Zeichenfolgendarstellung einer Zahl in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen. |
Parse(ReadOnlySpan<Char>, IFormatProvider) |
Analysiert eine Spanne von Zeichen in einen Wert. |
Parse(ReadOnlySpan<Byte>, IFormatProvider) |
Analysiert eine Spanne von UTF-8-Zeichen in einen Wert. |
Parse(String, NumberStyles) |
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen Stil in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen. |
Parse(String, NumberStyles, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen Stil und einem kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
public:
static short Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider);
public:
static short Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider) = System::Numerics::INumberBase<short>::Parse;
public static short Parse (string s, System.Globalization.NumberStyles style, IFormatProvider provider);
public static short Parse (string s, System.Globalization.NumberStyles style, IFormatProvider? provider);
static member Parse : string * System.Globalization.NumberStyles * IFormatProvider -> int16
Public Shared Function Parse (s As String, style As NumberStyles, provider As IFormatProvider) As Short
Parameter
- s
- String
Eine Zeichenfolge, die die zu konvertierende Zahl enthält.
- style
- NumberStyles
Eine bitweise Kombination von Enumerationswerten, die die Stilelemente angeben, die in s
vorhanden sein können. Ein häufig angegebener Wert ist Integer.
- provider
- IFormatProvider
Eine IFormatProvider-Schnittstelle, die kulturspezifische Formatierungsinformationen zu s
bereitstellt.
Gibt zurück
Eine 16-Bit-Ganzzahl mit Vorzeichen, die der Zahl in s
entspricht.
Implementiert
Ausnahmen
s
ist null
.
style
ist kein NumberStyles-Wert.
- oder -
style
ist keine Kombination von AllowHexSpecifier- und HexNumber-Werten.
s
weist kein mit style
kompatibles Format auf.
s
stellt eine Zahl dar, die kleiner als Int16.MinValue oder größer als Int16.MaxValue ist.
- oder -
s
enthält Dezimalstellen ungleich 0 (null).
Beispiele
Im folgenden Beispiel werden eine Vielzahl von style
Parametern und provider
verwendet, um die Zeichenfolgendarstellungen von Int16 Werten zu analysieren.
String^ value;
Int16 number;
NumberStyles style;
// Parse string using "." as the thousands separator
// and " " as the decimal separator.
value = "19 694,00";
style = NumberStyles::AllowDecimalPoint | NumberStyles::AllowThousands;
CultureInfo^ provider = gcnew CultureInfo("fr-FR");
number = Int16::Parse(value, style, provider);
Console::WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '19 694,00' converted to 19694.
try
{
number = Int16::Parse(value, style, CultureInfo::InvariantCulture);
Console::WriteLine("'{0}' converted to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}'.", value);
}
// Displays:
// Unable to parse '19 694,00'.
// Parse string using "$" as the currency symbol for en_GB and
// en-US cultures.
value = "$6,032.00";
style = NumberStyles::Number | NumberStyles::AllowCurrencySymbol;
provider = gcnew CultureInfo("en-GB");
try
{
number = Int16::Parse(value, style, CultureInfo::InvariantCulture);
Console::WriteLine("'{0}' converted to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}'.", value);
}
// Displays:
// Unable to parse '$6,032.00'.
provider = gcnew CultureInfo("en-US");
number = Int16::Parse(value, style, provider);
Console::WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '$6,032.00' converted to 6032.
string value;
short number;
NumberStyles style;
CultureInfo provider;
// Parse string using "." as the thousands separator
// and " " as the decimal separator.
value = "19 694,00";
style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;
provider = new CultureInfo("fr-FR");
number = Int16.Parse(value, style, provider);
Console.WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '19 694,00' converted to 19694.
try
{
number = Int16.Parse(value, style, CultureInfo.InvariantCulture);
Console.WriteLine("'{0}' converted to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
// Displays:
// Unable to parse '19 694,00'.
// Parse string using "$" as the currency symbol for en_GB and
// en-US cultures.
value = "$6,032.00";
style = NumberStyles.Number | NumberStyles.AllowCurrencySymbol;
provider = new CultureInfo("en-GB");
try
{
number = Int16.Parse(value, style, CultureInfo.InvariantCulture);
Console.WriteLine("'{0}' converted to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
// Displays:
// Unable to parse '$6,032.00'.
provider = new CultureInfo("en-US");
number = Int16.Parse(value, style, provider);
Console.WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '$6,032.00' converted to 6032.
// Parse string using "." as the thousands separator
// and " " as the decimal separator.
let value = "19 694,00"
let style = NumberStyles.AllowDecimalPoint ||| NumberStyles.AllowThousands
let provider = CultureInfo "fr-FR"
let number = Int16.Parse(value, style, provider)
printfn $"'{value}' converted to {number}."
// Displays:
// '19 694,00' converted to 19694.
try
let number = Int16.Parse(value, style, CultureInfo.InvariantCulture)
printfn $"'{value}' converted to {number}."
with :? FormatException ->
printfn $"Unable to parse '{value}'."
// Displays:
// Unable to parse '19 694,00'.
// Parse string using "$" as the currency symbol for en_GB and
// en-US cultures.
let value = "$6,032.00"
let style = NumberStyles.Number ||| NumberStyles.AllowCurrencySymbol
try
let number = Int16.Parse(value, style, CultureInfo.InvariantCulture)
printfn $"'{value}' converted to {number}."
with :? FormatException ->
printfn $"Unable to parse '{value}'."
// Displays:
// Unable to parse '$6,032.00'.
let provider = CultureInfo "en-US"
let number = Int16.Parse(value, style, provider)
printfn $"'{value}' converted to {number}."
// Displays:
// '$6,032.00' converted to 6032.
Dim value As String
Dim number As Short
Dim style As NumberStyles
Dim provider As CultureInfo
' Parse string using "." as the thousands separator
' and " " as the decimal separator.
value = "19 694,00"
style = NumberStyles.AllowDecimalPoint Or NumberStyles.AllowThousands
provider = New CultureInfo("fr-FR")
number = Int16.Parse(value, style, provider)
Console.WriteLine("'{0}' converted to {1}.", value, number)
' Displays:
' '19 694,00' converted to 19694.
Try
number = Int16.Parse(value, style, CultureInfo.InvariantCulture)
Console.WriteLine("'{0}' converted to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}'.", value)
End Try
' Displays:
' Unable to parse '19 694,00'.
' Parse string using "$" as the currency symbol for en_GB and
' en-US cultures.
value = "$6,032.00"
style = NumberStyles.Number Or NumberStyles.AllowCurrencySymbol
provider = New CultureInfo("en-GB")
Try
number = Int16.Parse(value, style, CultureInfo.InvariantCulture)
Console.WriteLine("'{0}' converted to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}'.", value)
End Try
' Displays:
' Unable to parse '$6,032.00'.
provider = New CultureInfo("en-US")
number = Int16.Parse(value, style, provider)
Console.WriteLine("'{0}' converted to {1}.", value, number)
' Displays:
' '$6,032.00' converted to 6032.
Hinweise
Der style
Parameter definiert die Stilelemente (z. B. Leerzeichen oder positive Vorzeichen), die im s
Parameter zulässig sind, damit der Analysevorgang erfolgreich ist. Es muss sich um eine Kombination von Bitflags aus der NumberStyles Enumeration handeln. Abhängig vom Wert von style
kann der s
Parameter die folgenden Elemente enthalten:
[ws] [$] [sign] [Digits,]digits[.fractional_digits][e[sign]digits][ws]
Oder, wenn style
enthält AllowHexSpecifier:
[ws]hexdigits[ws]
Elemente in eckigen Klammern ([ und ]) sind optional. In der folgenden Tabelle wird jedes Element beschrieben.
Element | Beschreibung |
---|---|
ws | Optionaler Leerraum. Leerzeichen können am Anfang von s angezeigt werden, wenn style das NumberStyles.AllowLeadingWhite Flag enthalten ist, oder am Ende von s , wenn style das NumberStyles.AllowTrailingWhite Flag enthält. |
$ | Ein kulturspezifisches Währungssymbol. Seine Position in der Zeichenfolge wird durch die - und NumberFormatInfo.CurrencyNegativePattern -NumberFormatInfo.CurrencyPositivePatternEigenschaft der aktuellen Kultur definiert. Das Währungssymbol der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowCurrencySymbol Flag enthält. |
sign | Ein optionales Zeichen. Das Zeichen kann am Anfang von s angezeigt werden, wenn style das NumberStyles.AllowLeadingSign Flag enthält, und es kann am Ende von s angezeigt werden, wenn style das NumberStyles.AllowTrailingSign Flag enthält. Klammern können in s verwendet werden, um einen negativen Wert anzugeben, wenn style das NumberStyles.AllowParentheses Flag enthalten ist. |
Zahlen | Eine Sequenz von Ziffern von 0 bis 9. |
, | Ein kulturspezifisches Tausendertrennzeichen. Das Tausendertrennzeichen der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowThousands Flag enthält. |
. | Ein kulturspezifisches Dezimaltrennzeichen. Das Dezimalzeichensymbol der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowDecimalPoint Flag enthält. |
fractional_digits | Eine Sequenz der 0-Ziffer. Teilziffern können in s angezeigt werden, wenn style das NumberStyles.AllowDecimalPoint Flag enthalten ist. Wenn eine andere Ziffer als 0 in fractional_digits angezeigt wird, löst die -Methode eine aus OverflowException. |
e | Das Zeichen "e" oder "E", das angibt, dass s in exponentieller Notation dargestellt werden kann. Der s Parameter kann eine Zahl in exponentieller Notation darstellen, wenn style das NumberStyles.AllowExponent Flag enthalten ist. Der s Parameter muss jedoch eine Zahl im Bereich des Int16 Datentyps darstellen und darf keine Bruchkomponente ungleich 0 (Null) aufweisen. |
hexdigits | Eine Sequenz von Hexadezimalstellen von 0 bis f oder 0 bis F. |
Hinweis
Alle endenden NUL-Zeichen (U+0000) in s
werden vom Analysevorgang ignoriert, unabhängig vom Wert des style
Arguments.
Eine Zeichenfolge mit nur Ziffern (die dem NumberStyles.None Format entsprechen) analysiert immer erfolgreich. Die meisten der verbleibenden NumberStyles Member steuern Elemente, die in dieser Eingabezeichenfolge möglicherweise vorhanden sein, aber nicht erforderlich sind. Die folgende Tabelle gibt an, wie sich einzelne NumberStyles Member auf die Elemente auswirken, die in s
vorhanden sein können.
Nicht zusammengesetzte NumberStyles-Werte | Zulässige Elemente in s zusätzlich zu Ziffern |
---|---|
NumberStyles.None | Nur Dezimalstellen. |
NumberStyles.AllowDecimalPoint | Die Elemente . und fractional_digits . Allerdings darf fractional_digits nur aus einer oder mehreren 0 Ziffern bestehen, oder es wird eine OverflowException ausgelöst. |
NumberStyles.AllowExponent | Der s Parameter kann auch exponentielle Notation verwenden. |
NumberStyles.AllowLeadingWhite | Das ws-Element am Anfang von s . |
NumberStyles.AllowTrailingWhite | Das ws-Element am Ende von s . |
NumberStyles.AllowLeadingSign | Ein Zeichen kann vor Ziffern angezeigt werden. |
NumberStyles.AllowTrailingSign | Ein Zeichen kann nach Ziffern angezeigt werden. |
NumberStyles.AllowParentheses | Das Zeichenelement in Form von Klammern, die den numerischen Wert einschließen. |
NumberStyles.AllowThousands | Das -Element. |
NumberStyles.AllowCurrencySymbol | Das $-Element. |
Wenn das NumberStyles.AllowHexSpecifier Flag verwendet wird, s
muss die Zeichenfolgendarstellung eines Hexadezimalwerts ohne Präfix sein. Beispielsweise analysiert "9AF3" erfolgreich, "0x9AF3" jedoch nicht. Die einzigen anderen Flags, die in style
vorhanden sein können, sind NumberStyles.AllowLeadingWhite und NumberStyles.AllowTrailingWhite. (Die NumberStyles Enumeration weist eine zusammengesetzte Zahlenformatvorlage auf, NumberStyles.HexNumberdie beide Leerzeichenflags enthält.)
Der provider
Parameter ist eine IFormatProvider Implementierung, deren GetFormat Methode ein NumberFormatInfo -Objekt abruft. Das NumberFormatInfo -Objekt stellt kulturspezifische Informationen zum Format von bereit s
. Wenn provider
ist null
, wird das NumberFormatInfo -Objekt für die aktuelle Kultur verwendet.
Weitere Informationen
Gilt für:
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Konvertiert die Spannendarstellung einer Zahl in einem angegebenen Stil und einem kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
public static short Parse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider? provider = default);
public static short Parse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider provider = default);
static member Parse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider -> int16
Public Shared Function Parse (s As ReadOnlySpan(Of Char), Optional style As NumberStyles = System.Globalization.NumberStyles.Integer, Optional provider As IFormatProvider = Nothing) As Short
Parameter
- s
- ReadOnlySpan<Char>
Die Spanne mit den Zeichen, die die zu konvertierende Zahl darstellen.
- style
- NumberStyles
Eine bitweise Kombination von Enumerationswerten, die die Stilelemente angeben, die in s
vorhanden sein können. Ein häufig angegebener Wert ist Integer.
- provider
- IFormatProvider
Eine IFormatProvider-Schnittstelle, die kulturspezifische Formatierungsinformationen zu s
bereitstellt.
Gibt zurück
Eine 16-Bit-Ganzzahl mit Vorzeichen, die der Zahl in s
entspricht.
Implementiert
Gilt für:
Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Analysiert eine Spanne von UTF-8-Zeichen in einen Wert.
public static short Parse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider -> int16
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), Optional style As NumberStyles = System.Globalization.NumberStyles.Integer, Optional provider As IFormatProvider = Nothing) As Short
Parameter
- utf8Text
- ReadOnlySpan<Byte>
Die Spanne der zu analysierenden UTF-8-Zeichen.
- style
- NumberStyles
Eine bitweise Kombination von Zahlenformatvorlagen, die in utf8Text
vorhanden sein können.
- provider
- IFormatProvider
Ein Objekt, das kulturspezifische Formatierungsinformationen zu utf8Text
bereitstellt.
Gibt zurück
Das Ergebnis der Analyse utf8Text
von .
Implementiert
Gilt für:
Parse(String, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen kulturspezifischen Format in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
public:
static short Parse(System::String ^ s, IFormatProvider ^ provider);
public:
static short Parse(System::String ^ s, IFormatProvider ^ provider) = IParsable<short>::Parse;
public static short Parse (string s, IFormatProvider provider);
public static short Parse (string s, IFormatProvider? provider);
static member Parse : string * IFormatProvider -> int16
Public Shared Function Parse (s As String, provider As IFormatProvider) As Short
Parameter
- s
- String
Eine Zeichenfolge, die die zu konvertierende Zahl enthält.
- provider
- IFormatProvider
Eine IFormatProvider-Schnittstelle, die kulturspezifische Formatierungsinformationen zu s
bereitstellt.
Gibt zurück
Eine 16-Bit-Ganzzahl mit Vorzeichen, die der Zahl in s
entspricht.
Implementiert
Ausnahmen
s
ist null
.
s
weist nicht das richtige Format auf.
s
stellt eine Zahl dar, die kleiner als Int16.MinValue oder größer als Int16.MaxValue ist.
Beispiele
Im folgenden Beispiel werden Zeichenfolgendarstellungen von Int16 Werten mit der Int16.Parse(String, IFormatProvider) -Methode analysiert.
String^ stringToConvert;
Int16 number;
stringToConvert = " 214 ";
try
{
number = Int16::Parse(stringToConvert, CultureInfo::InvariantCulture);
Console::WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException ^e)
{
Console::WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
stringToConvert = " + 214";
try
{
number = Int16::Parse(stringToConvert, CultureInfo::InvariantCulture);
Console::WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException ^e)
{
Console::WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
stringToConvert = " +214 ";
try
{
number = Int16::Parse(stringToConvert, CultureInfo::InvariantCulture);
Console::WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException ^e)
{
Console::WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
// The example displays the following output to the console:
// Converted ' 214 ' to 214.
// Unable to parse ' + 214'.
// Converted ' +214 ' to 214.
string stringToConvert;
short number;
stringToConvert = " 214 ";
try
{
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture);
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException)
{
Console.WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
stringToConvert = " + 214";
try
{
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture);
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException)
{
Console.WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
stringToConvert = " +214 ";
try
{
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture);
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException)
{
Console.WriteLine("'{0'} is out of range of the Int16 data type.",
stringToConvert);
}
// The example displays the following output to the console:
// Converted ' 214 ' to 214.
// Unable to parse ' + 214'.
// Converted ' +214 ' to 214.
let stringToConvert = " 214 "
try
let number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
printfn $"Converted '{stringToConvert}' to {number}."
with
| :? FormatException ->
printfn $"Unable to parse '{stringToConvert}'."
| :? OverflowException ->
printfn $"'{stringToConvert}' is out of range of the Int16 data type."
let stringToConvert = " + 214"
try
let number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
printfn $"Converted '{stringToConvert}' to {number}."
with
| :? FormatException ->
printfn $"Unable to parse '{stringToConvert}'."
| :? OverflowException ->
printfn $"'{stringToConvert}' is out of range of the Int16 data type."
let stringToConvert = " +214 "
try
let number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
printfn $"Converted '{stringToConvert}' to {number}."
with
| :? FormatException ->
printfn $"Unable to parse '{stringToConvert}'."
| :? OverflowException ->
printfn $"'{stringToConvert}' is out of range of the Int16 data type."
// The example displays the following output to the console:
// Converted ' 214 ' to 214.
// Unable to parse ' + 214'.
// Converted ' +214 ' to 214.
Dim stringToConvert As String
Dim number As Short
stringToConvert = " 214 "
Try
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}'.", stringToConvert)
Catch e As OverflowException
Console.WriteLine("'{0'} is out of range of the Int16 data type.", _
stringToConvert)
End Try
stringToConvert = " + 214"
Try
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}'.", stringToConvert)
Catch e As OverflowException
Console.WriteLine("'{0'} is out of range of the Int16 data type.", _
stringToConvert)
End Try
stringToConvert = " +214 "
Try
number = Int16.Parse(stringToConvert, CultureInfo.InvariantCulture)
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}'.", stringToConvert)
Catch e As OverflowException
Console.WriteLine("'{0'} is out of range of the Int16 data type.", _
stringToConvert)
End Try
' The example displays the following output to the console:
' Converted ' 214 ' to 214.
' Unable to parse ' + 214'.
' Converted ' +214 ' to 214.
Hinweise
Der s
Parameter enthält eine Nummer des Formulars:
[ws] [Sign]digits[ws]
Elemente in eckigen Klammern ([ und ]) sind optional. In der folgenden Tabelle wird jedes Element beschrieben.
Element | BESCHREIBUNG |
---|---|
ws | Ein optionaler Leerraum. |
Signieren | Ein optionales Zeichen. |
Zahlen | Eine Sequenz von Ziffern im Bereich von 0 bis 9. |
Der s
Parameter wird mithilfe des Stils NumberStyles.Integer interpretiert. Neben Dezimalstellen sind in s
nur führende und nachfolgende Leerzeichen zusammen mit einem führenden Zeichen zulässig. Verwenden Sie die -Methode, um die Stilelemente explizit zusammen mit den kulturspezifischen Formatierungsinformationen zu definieren, die Int16.Parse(String, NumberStyles, IFormatProvider) in s
vorhanden sein können.
Der provider
Parameter ist eine IFormatProvider Implementierung, die ein NumberFormatInfo -Objekt abruft. stellt NumberFormatInfo kulturspezifische Informationen zum Format von bereit s
. Wenn provider
ist null
, wird für NumberFormatInfo die aktuelle Kultur verwendet.
Weitere Informationen
Gilt für:
Parse(String)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Konvertiert die Zeichenfolgendarstellung einer Zahl in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
public:
static short Parse(System::String ^ s);
public static short Parse (string s);
static member Parse : string -> int16
Public Shared Function Parse (s As String) As Short
Parameter
- s
- String
Eine Zeichenfolge, die die zu konvertierende Zahl enthält.
Gibt zurück
Eine 16-Bit-Ganzzahl mit Vorzeichen, die der Zahl in s
entspricht.
Ausnahmen
s
ist null
.
s
weist nicht das richtige Format auf.
s
stellt eine Zahl dar, die kleiner als Int16.MinValue oder größer als Int16.MaxValue ist.
Beispiele
Im folgenden Beispiel wird veranschaulicht, wie ein Zeichenfolgenwert mithilfe der Int16.Parse(String) -Methode in einen 16-Bit-Ganzzahlwert mit Vorzeichen konvertiert wird. Der resultierende ganzzahlige Wert wird dann in der Konsole angezeigt.
String^ value;
Int16 number;
value = " 12603 ";
try
{
number = Int16::Parse(value);
Console::WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
value = " 16,054";
try
{
number = Int16::Parse(value);
Console::WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
value = " -17264";
try
{
number = Int16::Parse(value);
Console::WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
// The example displays the following output to the console:
// Converted ' 12603 ' to 12603.
// Unable to convert ' 16,054' to a 16-bit signed integer.
// Converted ' -17264' to -17264.
string value;
short number;
value = " 12603 ";
try
{
number = Int16.Parse(value);
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
value = " 16,054";
try
{
number = Int16.Parse(value);
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
value = " -17264";
try
{
number = Int16.Parse(value);
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.",
value);
}
// The example displays the following output to the console:
// Converted ' 12603 ' to 12603.
// Unable to convert ' 16,054' to a 16-bit signed integer.
// Converted ' -17264' to -17264.
let value = " 12603 "
try
let number = Int16.Parse value
printfn $"Converted '{value}' to {number}."
with :? FormatException ->
printfn $"Unable to convert '{value}' to a 16-bit signed integer."
let value = " 16,054"
try
let number = Int16.Parse value
printfn $"Converted '{value}' to {number}."
with :? FormatException ->
printfn "Unable to convert '{value}' to a 16-bit signed integer."
let value = " -17264"
try
let number = Int16.Parse value
printfn $"Converted '{value}' to {number}."
with :? FormatException ->
printfn "Unable to convert '{value}' to a 16-bit signed integer."
// The example displays the following output to the console:
// Converted ' 12603 ' to 12603.
// Unable to convert ' 16,054' to a 16-bit signed integer.
// Converted ' -17264' to -17264.
Dim value As String
Dim number As Short
value = " 12603 "
Try
number = Short.Parse(value)
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.", _
value)
End Try
value = " 16,054"
Try
number = Short.Parse(value)
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.", _
value)
End Try
value = " -17264"
Try
number = Short.Parse(value)
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to convert '{0}' to a 16-bit signed integer.", _
value)
End Try
' The example displays the following output to the console:
' Converted ' 12603 ' to 12603.
' Unable to convert ' 16,054' to a 16-bit signed integer.
' Converted ' -17264' to -17264.
Hinweise
Der s
Parameter enthält eine Nummer des Formulars:
[ws] [Sign]digits[ws]
Elemente in eckigen Klammern ([ und ]) sind optional. In der folgenden Tabelle wird jedes Element beschrieben.
Element | Beschreibung |
---|---|
ws | Optionaler Leerraum. |
sign | Ein optionales Zeichen. |
Zahlen | Eine Sequenz von Ziffern im Bereich von 0 bis 9. |
Der s
Parameter wird mithilfe des Stils NumberStyles.Integer interpretiert. Zusätzlich zu den Dezimalstellen des ganzzahligen Werts sind nur führende und nachfolgende Leerzeichen zusammen mit einem führenden Zeichen zulässig. Um explizit die Stilelemente zu definieren, die in s
vorhanden sein können, verwenden Sie entweder die Int16.Parse(String, NumberStyles) -Methode oder die Parse -Methode.
Der s
Parameter wird mithilfe der Formatierungsinformationen in einem NumberFormatInfo Objekt analysiert, das für die aktuelle Systemkultur initialisiert wird. Weitere Informationen finden Sie unter CurrentInfo. Um eine Zeichenfolge mithilfe der Formatierungsinformationen einer anderen Kultur zu analysieren, verwenden Sie die Int16.Parse(String, IFormatProvider) - oder - Int16.Parse(String, NumberStyles, IFormatProvider) Methode.
Weitere Informationen
Gilt für:
Parse(ReadOnlySpan<Char>, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Analysiert eine Spanne von Zeichen in einen Wert.
public:
static short Parse(ReadOnlySpan<char> s, IFormatProvider ^ provider) = ISpanParsable<short>::Parse;
public static short Parse (ReadOnlySpan<char> s, IFormatProvider? provider);
static member Parse : ReadOnlySpan<char> * IFormatProvider -> int16
Public Shared Function Parse (s As ReadOnlySpan(Of Char), provider As IFormatProvider) As Short
Parameter
- s
- ReadOnlySpan<Char>
Die Spanne der zu analysierenden Zeichen.
- provider
- IFormatProvider
Ein Objekt, das kulturspezifische Formatierungsinformationen zu s
bereitstellt.
Gibt zurück
Das Ergebnis der Analyse s
von .
Implementiert
Gilt für:
Parse(ReadOnlySpan<Byte>, IFormatProvider)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Analysiert eine Spanne von UTF-8-Zeichen in einen Wert.
public:
static short Parse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider) = IUtf8SpanParsable<short>::Parse;
public static short Parse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider);
static member Parse : ReadOnlySpan<byte> * IFormatProvider -> int16
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider) As Short
Parameter
- utf8Text
- ReadOnlySpan<Byte>
Die Spanne der zu analysierenden UTF-8-Zeichen.
- provider
- IFormatProvider
Ein Objekt, das kulturspezifische Formatierungsinformationen zu utf8Text
bereitstellt.
Gibt zurück
Das Ergebnis der Analyse utf8Text
von .
Implementiert
Gilt für:
Parse(String, NumberStyles)
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
- Quelle:
- Int16.cs
Konvertiert die Zeichenfolgendarstellung einer Zahl in einem angegebenen Stil in die entsprechende 16-Bit-Ganzzahl mit Vorzeichen.
public:
static short Parse(System::String ^ s, System::Globalization::NumberStyles style);
public static short Parse (string s, System.Globalization.NumberStyles style);
static member Parse : string * System.Globalization.NumberStyles -> int16
Public Shared Function Parse (s As String, style As NumberStyles) As Short
Parameter
- s
- String
Eine Zeichenfolge, die die zu konvertierende Zahl enthält.
- style
- NumberStyles
Eine bitweise Kombination von Enumerationswerten, die die Stilelemente angibt, die in s
vorhanden sein können. Ein häufig angegebener Wert ist Integer.
Gibt zurück
Eine 16-Bit-Ganzzahl mit Vorzeichen, die der Zahl in s
entspricht.
Ausnahmen
s
ist null
.
style
ist kein NumberStyles-Wert.
- oder -
style
ist keine Kombination von AllowHexSpecifier- und HexNumber-Werten.
s
weist kein mit style
kompatibles Format auf.
s
stellt eine Zahl dar, die kleiner als Int16.MinValue oder größer als Int16.MaxValue ist.
- oder -
s
enthält Dezimalstellen ungleich 0 (null).
Beispiele
Im folgenden Beispiel wird die Int16.Parse(String, NumberStyles) -Methode verwendet, um die Zeichenfolgendarstellungen von Int16 Werten mithilfe der en-US-Kultur zu analysieren.
using namespace System;
using namespace System::Globalization;
ref class ParseSample
{
public:
static void Main()
{
String^ value;
NumberStyles style;
// Parse a number with a thousands separator (throws an exception).
value = "14,644";
style = NumberStyles::None;
ParseSample::ParseToInt16(value, style);
style = NumberStyles::AllowThousands;
ParseToInt16(value, style);
// Parse a number with a thousands separator and decimal point.
value = "14,644.00";
style = NumberStyles::AllowThousands | NumberStyles::Integer |
NumberStyles::AllowDecimalPoint;
ParseToInt16(value, style);
// Parse a number with a fractional component (throws an exception).
value = "14,644.001";
ParseToInt16(value, style);
// Parse a number in exponential notation.
value = "145E02";
style = style | NumberStyles::AllowExponent;
ParseToInt16(value, style);
// Parse a number in exponential notation with a positive sign.
value = "145E+02";
ParseToInt16(value, style);
// Parse a number in exponential notation with a negative sign
// (throws an exception).
value = "145E-02";
ParseToInt16(value, style);
}
private:
static void ParseToInt16(String^ value, NumberStyles style)
{
try
{
Int16 number = Int16::Parse(value, style);
Console::WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException ^e)
{
Console::WriteLine("Unable to parse '{0}' with style {1}.", value,
style);
}
catch (OverflowException ^e)
{
Console::WriteLine("'{0}' is out of range of the Int16 type.", value);
}
}
};
int main()
{
ParseSample::Main();
Console::ReadLine();
return 0;
}
// The example displays the following output:
// Unable to parse '14,644' with style None.
// Converted '14,644' to 14644.
// Converted '14,644.00' to 14644.
// '14,644.001' is out of range of the Int16 type.
// Converted '145E02' to 14500.
// Converted '145E+02' to 14500.
// '145E-02' is out of range of the Int16 type.
using System;
using System.Globalization;
public class ParseSample
{
public static void Main()
{
string value;
NumberStyles style;
// Parse a number with a thousands separator (throws an exception).
value = "14,644";
style = NumberStyles.None;
ParseToInt16(value, style);
style = NumberStyles.AllowThousands;
ParseToInt16(value, style);
// Parse a number with a thousands separator and decimal point.
value = "14,644.00";
style = NumberStyles.AllowThousands | NumberStyles.Integer |
NumberStyles.AllowDecimalPoint;
ParseToInt16(value, style);
// Parse a number with a fractional component (throws an exception).
value = "14,644.001";
ParseToInt16(value, style);
// Parse a number in exponential notation.
value = "145E02";
style = style | NumberStyles.AllowExponent;
ParseToInt16(value, style);
// Parse a number in exponential notation with a positive sign.
value = "145E+02";
ParseToInt16(value, style);
// Parse a number in exponential notation with a negative sign
// (throws an exception).
value = "145E-02";
ParseToInt16(value, style);
}
private static void ParseToInt16(string value, NumberStyles style)
{
try
{
short number = Int16.Parse(value, style);
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}' with style {1}.", value,
style.ToString());
}
catch (OverflowException)
{
Console.WriteLine("'{0}' is out of range of the Int16 type.", value);
}
}
}
// The example displays the following output to the console:
// Unable to parse '14,644' with style None.
// Converted '14,644' to 14644.
// Converted '14,644.00' to 14644.
// '14,644.001' is out of range of the Int16 type.
// Converted '145E02' to 14500.
// Converted '145E+02' to 14500.
// '145E-02' is out of range of the Int16 type.
open System
open System.Globalization
let parseToInt16 (value: string) (style: NumberStyles) =
try
let number = Int16.Parse(value, style)
printfn $"Converted '{value}' to {number}."
with
| :? FormatException ->
printfn $"Unable to parse '{value}' with style {style}."
| :? OverflowException ->
printfn $"'{value}' is out of range of the Int16 type."
[<EntryPoint>]
let main _ =
// Parse a number with a thousands separator (throws an exception).
let value = "14,644"
let style = NumberStyles.None
parseToInt16 value style
let style = NumberStyles.AllowThousands
parseToInt16 value style
// Parse a number with a thousands separator and decimal point.
let value = "14,644.00"
let style = NumberStyles.AllowThousands ||| NumberStyles.Integer ||| NumberStyles.AllowDecimalPoint
parseToInt16 value style
// Parse a number with a fractional component (throws an exception).
let value = "14,644.001"
parseToInt16 value style
// Parse a number in exponential notation.
let value = "145E02"
let style = style ||| NumberStyles.AllowExponent
parseToInt16 value style
// Parse a number in exponential notation with a positive sign.
let value = "145E+02"
parseToInt16 value style
// Parse a number in exponential notation with a negative sign
// (throws an exception).
let value = "145E-02"
parseToInt16 value style
0
// The example displays the following output to the console:
// Unable to parse '14,644' with style None.
// Converted '14,644' to 14644.
// Converted '14,644.00' to 14644.
// '14,644.001' is out of range of the Int16 type.
// Converted '145E02' to 14500.
// Converted '145E+02' to 14500.
// '145E-02' is out of range of the Int16 type.
Imports System.Globalization
Module ParseSample
Public Sub Main()
Dim value As String
Dim style As NumberStyles
' Parse a number with a thousands separator (throws an exception).
value = "14,644"
style = NumberStyles.None
ParseToInt16(value, style)
style = NumberStyles.AllowThousands
ParseToInt16(value, style)
' Parse a number with a thousands separator and decimal point.
value = "14,644.00"
style = NumberStyles.AllowThousands Or NumberStyles.Integer Or _
NumberStyles.AllowDecimalPoint
ParseToInt16(value, style)
' Parse a number with a fractional component (throws an exception).
value = "14,644.001"
ParseToInt16(value, style)
' Parse a number in exponential notation.
value = "145E02"
style = style Or NumberStyles.AllowExponent
ParseToInt16(value, style)
' Parse a number in exponential notation with a positive sign.
value = "145E+02"
ParseToInt16(value, style)
' Parse a number in exponential notation with a negative sign
' (throws an exception).
value = "145E-02"
ParseToInt16(value, style)
End Sub
Private Sub ParseToInt16(value As String, style As NumberStyles)
Try
Dim number As Short = Int16.Parse(value, style)
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Catch e As FormatException
Console.WriteLine("Unable to parse '{0}' with style {1}.", value, _
style.ToString())
Catch e As OverflowException
Console.WriteLine("'{0}' is out of range of the Int16 type.", value)
End Try
End Sub
End Module
' The example displays the following output to the console:
' Unable to parse '14,644' with style None.
' Converted '14,644' to 14644.
' Converted '14,644.00' to 14644.
' '14,644.001' is out of range of the Int16 type.
' Converted '145E02' to 14500.
' Converted '145E+02' to 14500.
' '145E-02' is out of range of the Int16 type.
Hinweise
Der style
Parameter definiert die Stilelemente (z. B. Leerzeichen oder ein Zeichensymbol), die s
im Parameter zulässig sind, damit der Analysevorgang erfolgreich ist. Es muss sich um eine Kombination von Bitflags aus der NumberStyles Enumeration handeln. Abhängig vom Wert von style
kann der s
Parameter die folgenden Elemente enthalten:
[ws] [$] [sign] [Digits,]digits[.fractional_digits][e[sign]digits][ws]
Oder, wenn style
enthält AllowHexSpecifier:
[ws]hexdigits[ws]
Elemente in eckigen Klammern ([ und ]) sind optional. In der folgenden Tabelle wird jedes Element beschrieben.
Element | Beschreibung |
---|---|
ws | Optionaler Leerraum. Leerzeichen können am Anfang von s angezeigt werden, wenn style das NumberStyles.AllowLeadingWhite Flag enthalten ist, oder am Ende von s , wenn style das NumberStyles.AllowTrailingWhite Flag enthält. |
$ | Ein kulturspezifisches Währungssymbol. Seine Position in der Zeichenfolge wird durch die - und NumberFormatInfo.CurrencyNegativePattern -NumberFormatInfo.CurrencyPositivePatternEigenschaft der aktuellen Kultur definiert. Das Währungssymbol der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowCurrencySymbol Flag enthält. |
sign | Ein optionales Zeichen. Das Zeichen kann am Anfang von s angezeigt werden, wenn style das NumberStyles.AllowLeadingSign Flag enthält, und es kann am Ende von s angezeigt werden, wenn style das NumberStyles.AllowTrailingSign Flag enthält. Klammern können in s verwendet werden, um einen negativen Wert anzugeben, wenn style das NumberStyles.AllowParentheses Flag enthalten ist. |
Zahlen | Eine Sequenz von Ziffern von 0 bis 9. |
, | Ein kulturspezifisches Tausendertrennzeichen. Das Tausendertrennzeichen der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowThousands Flag enthalten ist. |
. | Ein kulturspezifisches Dezimalzeichensymbol. Das Dezimalstellensymbol der aktuellen Kultur kann in s angezeigt werden, wenn style das NumberStyles.AllowDecimalPoint Flag enthalten ist. |
fractional_digits | Eine Sequenz der 0-Ziffer. Bruchstellen können in s angezeigt werden, wenn style das NumberStyles.AllowDecimalPoint Flag enthalten ist. Wenn eine andere Ziffer als 0 in fractional_digits angezeigt wird, löst die -Methode einen aus OverflowException. |
e | Das Zeichen "e" oder "E", das angibt, dass s in exponentieller Notation dargestellt werden kann. Der s Parameter kann eine Zahl in exponentieller Notation darstellen, wenn style das NumberStyles.AllowExponent Flag enthalten ist. Der s Parameter muss jedoch eine Zahl im Bereich des Int16 Datentyps darstellen und darf keine Bruchkomponente ungleich 00 aufweisen. |
hexdigits | Eine Sequenz von Hexadezimalstellen von 0 bis f oder 0 bis F. |
Hinweis
Alle beendenden NUL-Zeichen (U+0000) in s
werden vom Analysevorgang ignoriert, unabhängig vom Wert des style
Arguments.
Eine Zeichenfolge nur mit Ziffern (die dem NumberStyles.None Format entspricht) analysiert immer erfolgreich. Die meisten der verbleibenden NumberStyles Member-Steuerelementelemente, die in dieser Eingabezeichenfolge möglicherweise vorhanden sein müssen, aber nicht erforderlich sind. Die folgende Tabelle gibt an, wie sich einzelne NumberStyles Member auf die Elemente auswirken, die möglicherweise in s
vorhanden sind.
Nicht zusammengesetzte NumberStyles-Werte | Zusätzlich zu Ziffern zulässige Elemente in s |
---|---|
NumberStyles.None | Nur Dezimalstellen. |
NumberStyles.AllowDecimalPoint | Die Elemente . und fractional_digits . Fractional_digits darf jedoch nur aus einer oder mehreren 0 Ziffern bestehen, oder ein OverflowException wird ausgelöst. |
NumberStyles.AllowExponent | Der s Parameter kann auch die exponentielle Notation verwenden. |
NumberStyles.AllowLeadingWhite | Das ws-Element am Anfang von s . |
NumberStyles.AllowTrailingWhite | Das ws-Element am Ende von s . |
NumberStyles.AllowLeadingSign | Vor Ziffern kann ein Zeichen angezeigt werden. |
NumberStyles.AllowTrailingSign | Ein Zeichen kann nach Ziffern angezeigt werden. |
NumberStyles.AllowParentheses | Das Zeichenelement in Form von Klammern, die den numerischen Wert einschließen. |
NumberStyles.AllowThousands | Das - Element. |
NumberStyles.AllowCurrencySymbol | Das $-Element. |
Wenn das NumberStyles.AllowHexSpecifier Flag verwendet wird, s
muss die Zeichenfolgendarstellung eines Hexadezimalwerts ohne Präfix sein. Beispielsweise analysiert "9AF3" erfolgreich, "0x9AF3" nicht. Die einzigen anderen Flags, die in style
vorhanden sein können, sind NumberStyles.AllowLeadingWhite und NumberStyles.AllowTrailingWhite. (Die NumberStyles Enumeration weist eine zusammengesetzte Zahlenart auf, NumberStyles.HexNumberdie beide Leerzeichenflags enthält.)
Der s
Parameter wird mithilfe der Formatierungsinformationen in einem NumberFormatInfo Objekt analysiert, das für die aktuelle Systemkultur initialisiert wird. Weitere Informationen finden Sie unter NumberFormatInfo.CurrentInfo. Um mithilfe der Formatierungsinformationen einer bestimmten Kultur zu analysieren s
, rufen Sie die -Methode auf Int16.Parse(String, NumberStyles, IFormatProvider) .
Weitere Informationen
Gilt für:
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Tickets als Feedbackmechanismus für Inhalte auslaufen lassen und es durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unter:Einreichen und Feedback anzeigen für