BigInteger.TryParse Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo.
Overload
| Nome | Descrizione |
|---|---|
| TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, BigInteger) |
Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo. |
| TryParse(ReadOnlySpan<Byte>, BigInteger) | |
| TryParse(ReadOnlySpan<Char>, BigInteger) |
Tenta di convertire la rappresentazione di un numero contenuto nell'intervallo di caratteri di sola lettura specificato, nell'equivalente BigInteger e restituisce un valore che indica se la conversione è riuscita. |
| TryParse(String, BigInteger) |
Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo. |
| TryParse(ReadOnlySpan<Byte>, IFormatProvider, BigInteger) | |
| TryParse(String, IFormatProvider, BigInteger) |
Tenta di analizzare una stringa in un valore. |
| TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, BigInteger) | |
| TryParse(String, NumberStyles, IFormatProvider, BigInteger) |
Tenta di convertire la rappresentazione di stringa di un numero in uno stile e un formato BigInteger specifico delle impostazioni cultura specificati nell'equivalente e restituisce un valore che indica se la conversione è riuscita. |
| TryParse(ReadOnlySpan<Char>, IFormatProvider, BigInteger) |
Tenta di analizzare un intervallo di caratteri in un valore. |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo.
public:
static bool TryParse(ReadOnlySpan<char> value, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = System::Numerics::INumberBase<System::Numerics::BigInteger>::TryParse;
public:
static bool TryParse(ReadOnlySpan<char> value, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result);
public static bool TryParse(ReadOnlySpan<char> value, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Numerics.BigInteger result);
public static bool TryParse(ReadOnlySpan<char> value, System.Globalization.NumberStyles style, IFormatProvider provider, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (value As ReadOnlySpan(Of Char), style As NumberStyles, provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- value
- ReadOnlySpan<Char>
Rappresentazione di un numero come intervallo di caratteri di sola lettura.
- style
- NumberStyles
Combinazione bit per bit di valori di enumerazione che indica gli elementi di stile che possono essere presenti in value. Un valore tipico da specificare è Integer.
- provider
- IFormatProvider
Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura su value.
- result
- BigInteger
Quando termina, questo metodo contiene l'equivalente BigInteger al numero contenuto in valueo Zero se la conversione non è riuscita. La conversione non riesce se il value parametro è un intervallo di caratteri vuoto o non è in un formato conforme a style. Questo parametro viene passato non inizializzato.
Restituisce
true se value è stata convertita correttamente; in caso contrario, false.
Eccezioni
style non è un NumberStyles valore.
oppure
style include il AllowHexSpecifier flag o HexNumber insieme a un altro valore.
Commenti
Questo overload è simile al Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) metodo , ad eccezione del fatto che non genera un'eccezione se la conversione non riesce. Questo metodo elimina la necessità di usare la gestione delle eccezioni per verificare se un FormatExceptionvalue oggetto non è valido e non può essere analizzato correttamente.
Il style parametro definisce gli elementi di stile,ad esempio uno spazio vuoto o un segno positivo o negativo, consentiti nel value parametro per l'esito positivo dell'operazione di analisi. Deve essere una combinazione di flag di bit dell'enumerazione NumberStyles . A seconda del valore di style, il value parametro può includere gli elementi seguenti:
[ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws]
Se il style parametro include AllowHexSpecifier, il value parametro può includere gli elementi seguenti:
[ws]hexdigits[ws]
Gli elementi tra parentesi quadre ([ e ]) sono facoltativi. La tabella seguente descrive i singoli elementi.
| Elemento | Descrzione |
|---|---|
| Ws | Spazio vuoto facoltativo. Lo spazio vuoto può essere visualizzato all'inizio di value se include il NumberStyles.AllowLeadingWhite flag o alla fine di value se style include il NumberStyles.AllowTrailingWhite flag .style |
| $ | Simbolo di valuta specifico delle impostazioni cultura. La posizione in value è definita dalla CurrencyPositivePattern proprietà dell'oggetto NumberFormatInfo restituito dal GetFormat metodo del provider parametro . Il simbolo di valuta può essere visualizzato in value se style include il NumberStyles.AllowCurrencySymbol flag . |
| sign | Segno facoltativo. Il segno può essere visualizzato all'inizio di value se include il NumberStyles.AllowLeadingSign flag e può essere visualizzato alla fine di value se style include il NumberStyles.AllowTrailingSignstyle flag. Le parentesi possono essere usate in value per indicare un valore negativo se style include il NumberStyles.AllowParentheses flag . |
| Cifre | Sequenza di cifre da 0 a 9. |
| , | Separatore di gruppo specifico delle impostazioni cultura. Il separatore di gruppo delle impostazioni cultura specificate da provider può essere visualizzato in value se style include il NumberStyles.AllowThousands flag . |
| . | Simbolo di virgola decimale specifica delle impostazioni cultura. Il simbolo di virgola decimale delle impostazioni cultura specificate da provider può essere visualizzato in value se style include il NumberStyles.AllowDecimalPoint flag . |
| Cifre_frazionarie | Una o più occorrenze della cifra 0. Le cifre frazionarie possono essere visualizzate solo value se style include il NumberStyles.AllowDecimalPoint flag . |
| E | Carattere "e" o "E", che indica che il valore è rappresentato nella notazione esponenziale (scientifica). Il value parametro può rappresentare un numero in notazione esponenziale se style include il NumberStyles.AllowExponent flag . |
| exponential_digits | Sequenza di cifre da 0 a 9. Il value parametro può rappresentare un numero in notazione esponenziale se style include il NumberStyles.AllowExponent flag . |
| hexdigits | Sequenza di cifre esadecimali da 0 a f o da 0 a F. |
Annotazioni
Qualsiasi carattere di terminazione NUL (U+0000) in s viene ignorato dall'operazione di analisi, indipendentemente dal valore dell'argomento style .
Valori non compositi NumberStyles |
Elementi consentiti in valore oltre alle cifre |
|---|---|
| None | Solo cifre decimali. |
| AllowDecimalPoint | Il separatore decimale (.) e gli elementi fractional_digits . Tuttavia, fractional_digits deve essere costituito da una o più cifre 0 oppure il metodo restituisce false. |
| AllowExponent | Carattere "e" o "E", che indica la notazione esponenziale, insieme a exponential_digits. Se value rappresenta un numero in notazione esponenziale, non può avere un componente frazionaria diverso da zero. |
| AllowLeadingWhite | Elemento ws all'inizio di value. |
| AllowTrailingWhite | Elemento ws alla fine di value. |
| AllowLeadingSign | Elemento segno prima delle cifre. |
| AllowTrailingSign | Elemento del segno dopo le cifre. |
| AllowParentheses | Elemento di segno sotto forma di parentesi che racchiudono il valore numerico. |
| AllowThousands | Elemento separatore di gruppo (,). |
| AllowCurrencySymbol | Elemento currency ($). |
| Currency | Tutti gli elementi. Tuttavia, value non può rappresentare un numero esadecimale o un numero in notazione esponenziale. |
| Float | L'elemento ws all'inizio o alla fine di value, firma all'inizio di valuee il simbolo decimale (.). Il value parametro può anche usare la notazione esponenziale. |
| Number | Elementi ws, sign, group separator (,) e separatore decimale (.). |
| Any | Tutti gli elementi. Tuttavia, value non può rappresentare un numero esadecimale. |
Se viene usato il NumberStyles.AllowHexSpecifier flag, value deve essere un valore esadecimale. Gli unici flag che possono essere presenti in style sono NumberStyles.AllowLeadingWhite e NumberStyles.AllowTrailingWhite. L'enumerazione NumberStyles ha uno stile composito, HexNumber, che include entrambi i flag di spazio vuoto.
Il provider parametro è un'implementazione IFormatProvider . Il GetFormat metodo restituisce un NumberFormatInfo oggetto che fornisce informazioni specifiche delle impostazioni cultura sul formato di value. Il provider parametro può essere uno dei seguenti:
Oggetto CultureInfo che rappresenta le impostazioni cultura che forniscono informazioni di formattazione. Il GetFormat metodo restituisce l'oggetto NumberFormatInfo che fornisce informazioni sulla formattazione numerica per tali impostazioni cultura.
Oggetto NumberFormatInfo che fornisce informazioni sulla formattazione numerica. La sua implementazione di GetFormat restituisce solo se stessa.
Oggetto personalizzato che implementa IFormatProvider. Il GetFormat metodo crea un'istanza e restituisce l'oggetto NumberFormatInfo che fornisce informazioni di formattazione.
Se provider è null, viene utilizzato l'oggetto NumberFormatInfo per le impostazioni cultura correnti.
Vedi anche
Si applica a
TryParse(ReadOnlySpan<Byte>, BigInteger)
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result);
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<byte> * BigInteger -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), ByRef result As BigInteger) As Boolean
Parametri
- utf8Text
- ReadOnlySpan<Byte>
- result
- BigInteger
Restituisce
Si applica a
TryParse(ReadOnlySpan<Char>, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di convertire la rappresentazione di un numero contenuto nell'intervallo di caratteri di sola lettura specificato, nell'equivalente BigInteger e restituisce un valore che indica se la conversione è riuscita.
public:
static bool TryParse(ReadOnlySpan<char> value, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result);
public static bool TryParse(ReadOnlySpan<char> value, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<char> * BigInteger -> bool
Public Shared Function TryParse (value As ReadOnlySpan(Of Char), ByRef result As BigInteger) As Boolean
Parametri
- value
- ReadOnlySpan<Char>
Rappresentazione di un numero come intervallo di caratteri di sola lettura.
- result
- BigInteger
Quando termina, questo metodo contiene l'equivalente BigInteger al numero contenuto in valueo zero (0) se la conversione non riesce. La conversione non riesce se il value parametro è un intervallo di caratteri vuoto o non è del formato corretto. Questo parametro viene passato non inizializzato.
Restituisce
true se value è stata convertita correttamente; in caso contrario, false.
Vedi anche
Si applica a
TryParse(String, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo.
public:
static bool TryParse(System::String ^ value, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result);
public static bool TryParse(string value, out System.Numerics.BigInteger result);
public static bool TryParse(string? value, out System.Numerics.BigInteger result);
static member TryParse : string * BigInteger -> bool
Public Shared Function TryParse (value As String, ByRef result As BigInteger) As Boolean
Parametri
- value
- String
Rappresentazione di stringa di un numero.
- result
- BigInteger
Quando termina, questo metodo contiene l'equivalente BigInteger al numero contenuto in valueo zero (0) se la conversione non riesce. La conversione non riesce se il value parametro è null o non è del formato corretto. Questo parametro viene passato non inizializzato.
Restituisce
true se value è stata convertita correttamente; in caso contrario, false.
Eccezioni
value è null.
Esempio
Nell'esempio seguente viene utilizzato il TryParse(String, BigInteger) metodo per creare un'istanza di due BigInteger oggetti. Se le conversioni hanno esito positivo, moltiplica ogni oggetto per un altro numero e quindi chiama il Compare metodo per determinare la relazione tra i due oggetti.
BigInteger number1, number2;
bool succeeded1 = BigInteger.TryParse("-12347534159895123", out number1);
bool succeeded2 = BigInteger.TryParse("987654321357159852", out number2);
if (succeeded1 && succeeded2)
{
number1 *= 3;
number2 *= 2;
switch (BigInteger.Compare(number1, number2))
{
case -1:
Console.WriteLine("{0} is greater than {1}.", number2, number1);
break;
case 0:
Console.WriteLine("{0} is equal to {1}.", number1, number2);
break;
case 1:
Console.WriteLine("{0} is greater than {1}.", number1, number2);
break;
}
}
else
{
if (!succeeded1)
Console.WriteLine("Unable to initialize the first BigInteger value.");
if (!succeeded2)
Console.WriteLine("Unable to initialize the second BigInteger value.");
}
// The example displays the following output:
// 1975308642714319704 is greater than -37042602479685369.
let mutable number1 = BigInteger.Zero
let mutable number2 = BigInteger.Zero
let succeeded1 = BigInteger.TryParse("-12347534159895123", &number1)
let succeeded2 = BigInteger.TryParse("987654321357159852", &number2)
if succeeded1 && succeeded2 then
number1 <- number1 * 3I
number2 <- number2 * 2I
match BigInteger.Compare(number1, number2) with
| -1 -> printfn $"{number2} is greater than {number2}."
| 0 -> printfn $"{number1} is equal to {number2}."
| 1
| _ -> printfn $"{number1} is greater than {number2}."
else
if not succeeded1 then
printfn "Unable to initialize the first BigInteger value."
if not succeeded2 then
printfn "Unable to initialize the second BigInteger value."
// The example displays the following output:
// 1975308642714319704 is greater than -37042602479685369.
Dim number1 As BigInteger = BigInteger.Zero
Dim number2 As BigInteger = BigInteger.Zero
Dim succeeded1 As Boolean = BigInteger.TryParse("-12347534159895123", number1)
Dim succeeded2 As Boolean = BigInteger.TryParse("987654321357159852", number2)
If succeeded1 AndAlso succeeded2
number1 *= 3
number2 *= 2
Select Case BigInteger.Compare(number1, number2)
Case -1
Console.WriteLine("{0} is greater than {1}.", number2, number1)
Case 0
Console.WriteLine("{0} is equal to {1}.", number1, number2)
Case 1
Console.WriteLine("{0} is greater than {1}.", number1, number2)
End Select
Else
If Not succeeded1 Then
Console.WriteLine("Unable to initialize the first BigInteger value.")
End If
If Not succeeded2 Then
Console.WriteLine("Unable to initialize the second BigInteger value.")
End If
End If
' The example displays the following output:
' 1975308642714319704 is greater than -37042602479685369.
Commenti
Il TryParse(String, BigInteger) metodo è simile al Parse(String) metodo , ad eccezione del fatto che non genera un'eccezione se la conversione non riesce. Questo metodo elimina la necessità di usare la gestione delle eccezioni per verificare se un FormatExceptionvalue oggetto non è valido e non può essere analizzato correttamente.
Il value parametro deve essere la rappresentazione di stringa di un numero decimale nel formato seguente:
[ws][sign]digits[ws]
Gli elementi tra parentesi quadre ([ e ]) sono facoltativi. La tabella seguente descrive i singoli elementi.
| Elemento | Descrzione |
|---|---|
| Ws | Spazio vuoto facoltativo. |
| sign | Segno facoltativo. I caratteri di segno validi sono determinati dalle NumberFormatInfo.NegativeSign proprietà e NumberFormatInfo.PositiveSign delle impostazioni cultura correnti. |
| Cifre | Sequenza di cifre decimali comprese tra 0 e 9. |
Annotazioni
La stringa specificata dal value parametro non può contenere separatori di gruppo o separatori decimali e non può avere una parte decimale.
Il value parametro viene interpretato utilizzando lo NumberStyles.Integer stile . Oltre alle cifre decimali, sono consentiti solo gli spazi iniziali e finali con un segno iniziale. Per definire in modo esplicito gli elementi di stile con le informazioni di formattazione specifiche delle impostazioni cultura che possono essere presenti in value, chiamare il TryParse(String, NumberStyles, IFormatProvider, BigInteger) metodo .
Il value parametro viene analizzato usando le informazioni di formattazione in un NumberFormatInfo oggetto per le impostazioni cultura correnti. Per altre informazioni, vedere NumberFormatInfo.CurrentInfo.
Questo overload interpreta tutte le cifre nel value parametro come cifre decimali. Per analizzare la rappresentazione di stringa di un numero esadecimale, chiamare invece l'overload TryParse(String, NumberStyles, IFormatProvider, BigInteger) .
Vedi anche
Si applica a
TryParse(ReadOnlySpan<Byte>, IFormatProvider, BigInteger)
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = IUtf8SpanParsable<System::Numerics::BigInteger>::TryParse;
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<byte> * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- utf8Text
- ReadOnlySpan<Byte>
- provider
- IFormatProvider
- result
- BigInteger
Restituisce
Si applica a
TryParse(String, IFormatProvider, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di analizzare una stringa in un valore.
public:
static bool TryParse(System::String ^ s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = IParsable<System::Numerics::BigInteger>::TryParse;
public static bool TryParse(string? s, IFormatProvider? provider, out System.Numerics.BigInteger result);
static member TryParse : string * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (s As String, provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- s
- String
Stringa da analizzare.
- provider
- IFormatProvider
Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura su s.
- result
- BigInteger
Quando termina, questo metodo contiene il risultato dell'analisi s corretta o di un valore non definito in caso di errore.
Restituisce
true se s è stato analizzato correttamente; in caso contrario, false.
Si applica a
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, BigInteger)
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = System::Numerics::INumberBase<System::Numerics::BigInteger>::TryParse;
public static bool TryParse(ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), style As NumberStyles, provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- utf8Text
- ReadOnlySpan<Byte>
- style
- NumberStyles
- provider
- IFormatProvider
- result
- BigInteger
Restituisce
Si applica a
TryParse(String, NumberStyles, IFormatProvider, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di convertire la rappresentazione di stringa di un numero in uno stile e un formato BigInteger specifico delle impostazioni cultura specificati nell'equivalente e restituisce un valore che indica se la conversione è riuscita.
public:
static bool TryParse(System::String ^ value, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result);
public:
static bool TryParse(System::String ^ value, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = System::Numerics::INumberBase<System::Numerics::BigInteger>::TryParse;
public static bool TryParse(string value, System.Globalization.NumberStyles style, IFormatProvider provider, out System.Numerics.BigInteger result);
public static bool TryParse(string? value, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Numerics.BigInteger result);
static member TryParse : string * System.Globalization.NumberStyles * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (value As String, style As NumberStyles, provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- value
- String
Rappresentazione di stringa di un numero. La stringa viene interpretata usando lo stile specificato da style.
- style
- NumberStyles
Combinazione bit per bit di valori di enumerazione che indica gli elementi di stile che possono essere presenti in value. Un valore tipico da specificare è Integer.
- provider
- IFormatProvider
Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura su value.
- result
- BigInteger
Quando termina, questo metodo contiene l'equivalente BigInteger al numero contenuto in valueo Zero se la conversione non è riuscita. La conversione ha esito negativo se il value parametro è o non è null in un formato conforme a style. Questo parametro viene passato non inizializzato.
Restituisce
true se il value parametro è stato convertito correttamente; in caso contrario, false.
Eccezioni
style non è un NumberStyles valore.
oppure
style include il AllowHexSpecifier flag o HexNumber insieme a un altro valore.
Esempio
Nell'esempio seguente vengono effettuate alcune chiamate al TryParse(String, NumberStyles, IFormatProvider, BigInteger) metodo usando varie combinazioni di valori per i style parametri e provider .
string numericString;
BigInteger number = BigInteger.Zero;
// Call TryParse with default values of style and provider.
numericString = " -300 ";
if (BigInteger.TryParse(numericString, NumberStyles.Integer,
null, out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with the default value of style and
// a provider supporting the tilde as negative sign.
numericString = " -300 ";
if (BigInteger.TryParse(numericString, NumberStyles.Integer,
new BigIntegerFormatProvider(), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with only AllowLeadingWhite and AllowTrailingWhite.
// Method returns false because of presence of negative sign.
numericString = " -500 ";
if (BigInteger.TryParse(numericString,
NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite,
new BigIntegerFormatProvider(), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with AllowHexSpecifier and a hex value.
numericString = "F14237FFAAC086455192";
if (BigInteger.TryParse(numericString,
NumberStyles.AllowHexSpecifier,
null, out number))
Console.WriteLine("'{0}' was converted to {1} (0x{1:x}).",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with AllowHexSpecifier and a negative hex value.
// Conversion fails because of presence of negative sign.
numericString = "-3af";
if (BigInteger.TryParse(numericString, NumberStyles.AllowHexSpecifier,
new BigIntegerFormatProvider(), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with only NumberStyles.None.
// Conversion fails because of presence of white space and sign.
numericString = " -300 ";
if (BigInteger.TryParse(numericString, NumberStyles.None,
new BigIntegerFormatProvider(), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
// Conversion fails because the string is formatted for the en-US culture.
numericString = "9,031,425,666,123,546.00";
if (BigInteger.TryParse(numericString, NumberStyles.Any,
new CultureInfo("fr-FR"), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
// Conversion succeeds because the string is properly formatted
// For the fr-FR culture.
numericString = "9 031 425 666 123 546,00";
if (BigInteger.TryParse(numericString, NumberStyles.Any,
new CultureInfo("fr-FR"), out number))
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number);
else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString);
// The example displays the following output:
// ' -300 ' was converted to -300.
// Conversion of ' -300 ' to a BigInteger failed.
// Conversion of ' -500 ' to a BigInteger failed.
// 'F14237FFAAC086455192' was converted to -69613977002644837412462 (0xf14237ffaac086455192).
// Conversion of '-3af' to a BigInteger failed.
// Conversion of ' -300 ' to a BigInteger failed.
// Conversion of '9,031,425,666,123,546.00' to a BigInteger failed.
// '9 031 425 666 123 546,00' was converted to 9031425666123546.
// Call TryParse with default values of style and provider.
let numericString = " -300 "
match BigInteger.TryParse(numericString, NumberStyles.Integer, null) with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with the default value of style and
// a provider supporting the tilde as negative sign.
let numericString = " -300 "
match BigInteger.TryParse(numericString, NumberStyles.Integer, new BigIntegerFormatProvider()) with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with only AllowLeadingWhite and AllowTrailingWhite.
// Method returns false because of presence of negative sign.
let numericString = " -500 "
match
BigInteger.TryParse(
numericString,
NumberStyles.AllowLeadingWhite ||| NumberStyles.AllowTrailingWhite,
new BigIntegerFormatProvider()
)
with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with AllowHexSpecifier and a hex value.
let numericString = "F14237FFAAC086455192"
match BigInteger.TryParse(numericString, NumberStyles.AllowHexSpecifier, null) with
| true, number -> printfn $"The string '{numericString}' parses to {number}, or 0x{number:x}."
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with AllowHexSpecifier and a negative hex value.
// Conversion fails because of presence of negative sign.
let numericString = "-3af"
match BigInteger.TryParse(numericString, NumberStyles.AllowHexSpecifier, null) with
| true, number -> printfn $"The string '{numericString}' parses to {number}, or 0x{number:x}."
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with only NumberStyles.None.
// Conversion fails because of presence of white space and sign.
let numericString = " -300 "
match BigInteger.TryParse(numericString, NumberStyles.None, new BigIntegerFormatProvider()) with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
// Conversion fails because the string is formatted for the en-US culture.
let numericString = "9,031,425,666,123,546.00"
match BigInteger.TryParse(numericString, NumberStyles.Any, new CultureInfo("fr-FR")) with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
// Conversion succeeds because the string is properly formatted
// For the fr-FR culture.
let numericString = "9 031 425 666 123 546,00"
match BigInteger.TryParse(numericString, NumberStyles.Any, new CultureInfo("fr-FR")) with
| true, number -> printfn $"The string '{numericString}' parses to {number}"
| _ -> printfn $"Conversion of {numericString} to a BigInteger failed."
// The example displays the following output:
// ' -300 ' was converted to -300.
// Conversion of ' -300 ' to a BigInteger failed.
// Conversion of ' -500 ' to a BigInteger failed.
// 'F14237FFAAC086455192' was converted to -69613977002644837412462 (0xf14237ffaac086455192).
// Conversion of '-3af' to a BigInteger failed.
// Conversion of ' -300 ' to a BigInteger failed.
// Conversion of '9,031,425,666,123,546.00' to a BigInteger failed.
// '9 031 425 666 123 546,00' was converted to 9031425666123546.
Dim numericString As String
Dim number As BigInteger = BigInteger.Zero
' Call TryParse with default values of style and provider.
numericString = " -300 "
If BigInteger.TryParse(numericString, NumberStyles.Integer,
Nothing, number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with the default value of style and
' a provider supporting the tilde as negative sign.
numericString = " -300 "
If BigInteger.TryParse(numericString, NumberStyles.Integer,
New BigIntegerFormatProvider(), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with only AllowLeadingWhite and AllowTrailingWhite.
' Method returns false because of presence of negative sign.
numericString = " -500 "
If BigInteger.TryParse(numericString,
NumberStyles.AllowLeadingWhite Or NumberStyles.AllowTrailingWhite,
New BigIntegerFormatProvider(), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with AllowHexSpecifier and a hex value.
numericString = "F14237FFAAC086455192"
If BigInteger.TryParse(numericString,
NumberStyles.AllowHexSpecifier,
Nothing, number) Then
Console.WriteLine("'{0}' was converted to {1} (0x{1:x}).",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with AllowHexSpecifier and a negative hex value.
' Conversion fails because of presence of negative sign.
numericString = "-3af"
If BigInteger.TryParse(numericString, NumberStyles.AllowHexSpecifier,
New BigIntegerFormatProvider(), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with only NumberStyles.None.
' Conversion fails because of presence of white space and sign.
numericString = " -300 "
If BigInteger.TryParse(numericString, NumberStyles.None,
New BigIntegerFormatProvider(), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
' Conversion fails because the string is formatted for the en-US culture.
numericString = "9,031,425,666,123,546.00"
If BigInteger.TryParse(numericString, NumberStyles.Any,
New CultureInfo("fr-FR"), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' Call TryParse with NumberStyles.Any and a provider for the fr-FR culture.
' Conversion succeeds because the string is properly formatted
' For the fr-FR culture.
numericString = "9 031 425 666 123 546,00"
If BigInteger.TryParse(numericString, NumberStyles.Any,
New CultureInfo("fr-FR"), number) Then
Console.WriteLine("'{0}' was converted to {1}.",
numericString, number)
Else
Console.WriteLine("Conversion of '{0}' to a BigInteger failed.",
numericString)
End If
' The example displays the following output:
' ' -300 ' was converted to -300.
' Conversion of ' -300 ' to a BigInteger failed.
' Conversion of ' -500 ' to a BigInteger failed.
' 'F14237FFAAC086455192' was converted to -69613977002644837412462 (0xf14237ffaac086455192).
' Conversion of '-3af' to a BigInteger failed.
' Conversion of ' -300 ' to a BigInteger failed.
' Conversion of '9,031,425,666,123,546.00' to a BigInteger failed.
' '9 031 425 666 123 546,00' was converted to 9031425666123546.
Un numero di singole chiamate al TryParse(String, NumberStyles, IFormatProvider, BigInteger) metodo passa un'istanza della classe seguente BigIntegerFormatProvider , che definisce una tilde (~) come segno negativo.
public class BigIntegerFormatProvider : IFormatProvider
{
public object GetFormat(Type formatType)
{
if (formatType == typeof(NumberFormatInfo))
{
NumberFormatInfo numberFormat = new NumberFormatInfo();
numberFormat.NegativeSign = "~";
return numberFormat;
}
else
{
return null;
}
}
}
type BigIntegerFormatProvider() =
interface IFormatProvider with
member _.GetFormat(formatType: Type) =
if formatType = typeof<NumberFormatInfo> then
let numberFormat = new NumberFormatInfo()
numberFormat.NegativeSign <- "~"
numberFormat
else
null
Public Class BigIntegerFormatProvider : Implements IFormatProvider
Public Function GetFormat(formatType As Type) As Object _
Implements IFormatProvider.GetFormat
If formatType Is GetType(NumberFormatInfo) Then
Dim numberFormat As New NumberFormatInfo
numberFormat.NegativeSign = "~"
Return numberFormat
Else
Return Nothing
End If
End Function
End Class
Commenti
Il TryParse(String, NumberStyles, IFormatProvider, BigInteger) metodo è simile al Parse(String, NumberStyles, IFormatProvider) metodo , ad eccezione del fatto che non genera un'eccezione se la conversione non riesce. Questo metodo elimina la necessità di usare la gestione delle eccezioni per verificare se un FormatExceptionvalue oggetto non è valido e non può essere analizzato correttamente.
Il style parametro definisce gli elementi di stile,ad esempio uno spazio vuoto o un segno positivo o negativo, consentiti nel value parametro per l'esito positivo dell'operazione di analisi. Deve essere una combinazione di flag di bit dell'enumerazione NumberStyles . A seconda del valore di style, il value parametro può includere gli elementi seguenti:
[ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws]
Se il style parametro include AllowHexSpecifier, il value parametro può includere gli elementi seguenti:
[ws]hexdigits[ws]
Gli elementi tra parentesi quadre ([ e ]) sono facoltativi. La tabella seguente descrive i singoli elementi.
| Elemento | Descrzione |
|---|---|
| Ws | Spazio vuoto facoltativo. Lo spazio vuoto può essere visualizzato all'inizio di value se include il NumberStyles.AllowLeadingWhite flag o alla fine di value se style include il NumberStyles.AllowTrailingWhite flag .style |
| $ | Simbolo di valuta specifico delle impostazioni cultura. La posizione nella stringa è definita dalla CurrencyPositivePattern proprietà dell'oggetto NumberFormatInfo restituito dal GetFormat metodo del provider parametro . Il simbolo di valuta può essere visualizzato in value se style include il NumberStyles.AllowCurrencySymbol flag . |
| sign | Segno facoltativo. Il segno può essere visualizzato all'inizio di value se include il NumberStyles.AllowLeadingSign flag e può essere visualizzato alla fine di value se style include il NumberStyles.AllowTrailingSignstyle flag. Le parentesi possono essere usate in value per indicare un valore negativo se style include il NumberStyles.AllowParentheses flag . |
| Cifre | Sequenza di cifre da 0 a 9. |
| , | Separatore di gruppo specifico delle impostazioni cultura. Il separatore di gruppo delle impostazioni cultura specificate da provider può essere visualizzato in value se style include il NumberStyles.AllowThousands flag . |
| . | Simbolo di virgola decimale specifica delle impostazioni cultura. Il simbolo di virgola decimale delle impostazioni cultura specificate da provider può essere visualizzato in value se style include il NumberStyles.AllowDecimalPoint flag . |
| Cifre_frazionarie | Una o più occorrenze della cifra 0. Le cifre frazionarie possono essere visualizzate solo value se style include il NumberStyles.AllowDecimalPoint flag . |
| E | Carattere "e" o "E", che indica che il valore è rappresentato nella notazione esponenziale (scientifica). Il value parametro può rappresentare un numero in notazione esponenziale se style include il NumberStyles.AllowExponent flag . |
| exponential_digits | Sequenza di cifre da 0 a 9. Il value parametro può rappresentare un numero in notazione esponenziale se style include il NumberStyles.AllowExponent flag . |
| hexdigits | Sequenza di cifre esadecimali da 0 a f o da 0 a F. |
Annotazioni
Qualsiasi carattere di terminazione NUL (U+0000) in s viene ignorato dall'operazione di analisi, indipendentemente dal valore dell'argomento style .
Una stringa con solo cifre decimali (che corrisponde al NumberStyles.None flag) analizza sempre correttamente. La maggior parte degli elementi di controllo membri rimanenti NumberStyles che possono essere presenti, ma non devono essere presenti, in questa stringa di input. La tabella seguente indica in che modo i singoli NumberStyles membri influiscono sugli elementi che possono essere presenti in value.
Valori non compositi NumberStyles |
Elementi consentiti in valore oltre alle cifre |
|---|---|
| None | Solo cifre decimali. |
| AllowDecimalPoint | Il separatore decimale (.) e gli elementi fractional_digits . Tuttavia, fractional_digits deve essere costituito da una o più cifre 0 oppure il metodo restituisce false. |
| AllowExponent | Carattere "e" o "E", che indica la notazione esponenziale, insieme a exponential_digits. Se value rappresenta un numero in notazione esponenziale, non può avere un componente frazionaria diverso da zero. |
| AllowLeadingWhite | Elemento ws all'inizio di value. |
| AllowTrailingWhite | Elemento ws alla fine di value. |
| AllowLeadingSign | Elemento segno prima delle cifre. |
| AllowTrailingSign | Elemento del segno dopo le cifre. |
| AllowParentheses | Elemento di segno sotto forma di parentesi che racchiudono il valore numerico. |
| AllowThousands | Elemento separatore di gruppo (,). |
| AllowCurrencySymbol | Elemento currency ($). |
| Currency | Tutti gli elementi. Tuttavia, value non può rappresentare un numero esadecimale o un numero in notazione esponenziale. |
| Float | L'elemento ws all'inizio o alla fine di value, firma all'inizio di valuee il simbolo decimale (.). Il value parametro può anche usare la notazione esponenziale. |
| Number | Elementi ws, sign, group separator (,) e separatore decimale (.). |
| Any | Tutti gli elementi. Tuttavia, value non può rappresentare un numero esadecimale. |
Importante
Se si usa il TryParse metodo per eseguire il round trip della rappresentazione di stringa di un BigInteger valore restituito dal ToString metodo , è necessario utilizzare il BigInteger.ToString(String) metodo con l'identificatore di formato "R" per generare la rappresentazione di stringa del BigInteger valore. In caso contrario, la rappresentazione di stringa di BigInteger mantiene solo le 50 cifre più significative del valore originale e i dati possono andare persi quando si usa il TryParse metodo per ripristinare il BigInteger valore.
Se viene usato il NumberStyles.AllowHexSpecifier flag, value deve essere un valore esadecimale. Gli unici flag che possono essere presenti in style sono NumberStyles.AllowLeadingWhite e NumberStyles.AllowTrailingWhite. L'enumerazione NumberStyles ha uno stile composito, HexNumber, che include entrambi i flag di spazio vuoto.
Annotazioni
Se value è la rappresentazione di stringa di un numero esadecimale, non può essere preceduta da alcuna decorazione (ad esempio 0x o &h) che la differenzia come numero esadecimale. In questo modo la conversione non riesce.
Se value è una stringa esadecimale, il TryParse(String, NumberStyles, IFormatProvider, BigInteger) metodo interpreta value come numero negativo archiviato usando la rappresentazione di complemento di due se le prime due cifre esadecimali sono maggiori o uguali a 0x80. In altre parole, il metodo interpreta il bit di ordine più alto del primo byte in value come bit del segno. Per assicurarsi che una stringa esadecimale venga interpretata correttamente come numero positivo, la prima cifra in value deve avere un valore pari a zero. Ad esempio, il metodo interpreta 0x80 come valore negativo, ma interpreta 0x080 o 0x0080 come valore positivo. Nell'esempio seguente viene illustrata la differenza tra stringhe esadecimali che rappresentano valori negativi e positivi.
using System;
using System.Globalization;
using System.Numerics;
public class Example
{
public static void Main()
{
string[] hexStrings = { "80", "E293", "F9A2FF", "FFFFFFFF",
"080", "0E293", "0F9A2FF", "0FFFFFFFF",
"0080", "00E293", "00F9A2FF", "00FFFFFFFF" };
BigInteger number = BigInteger.Zero;
foreach (string hexString in hexStrings)
{
if (BigInteger.TryParse(hexString, NumberStyles.AllowHexSpecifier,
null, out number))
Console.WriteLine("Converted 0x{0} to {1}.", hexString, number);
else
Console.WriteLine("Cannot convert '{0}' to a BigInteger.", hexString);
}
}
}
// The example displays the following output:
// Converted 0x80 to -128.
// Converted 0xE293 to -7533.
// Converted 0xF9A2FF to -417025.
// Converted 0xFFFFFFFF to -1.
// Converted 0x080 to 128.
// Converted 0x0E293 to 58003.
// Converted 0x0F9A2FF to 16360191.
// Converted 0x0FFFFFFFF to 4294967295.
// Converted 0x0080 to 128.
// Converted 0x00E293 to 58003.
// Converted 0x00F9A2FF to 16360191.
// Converted 0x00FFFFFFFF to 4294967295.
open System.Globalization
open System.Numerics
let hexStrings =
[| "80"
"E293"
"F9A2FF"
"FFFFFFFF"
"080"
"0E293"
"0F9A2FF"
"0FFFFFFFF"
"0080"
"00E293"
"00F9A2FF"
"00FFFFFFFF" |]
for hexString in hexStrings do
match BigInteger.TryParse(hexString, NumberStyles.AllowHexSpecifier, null) with
| true, number -> printfn $"Converted 0x{hexString} to {number}."
| _ -> printfn $"Cannot convert '{hexString}' to a BigInteger."
// The example displays the following output:
// Converted 0x80 to -128.
// Converted 0xE293 to -7533.
// Converted 0xF9A2FF to -417025.
// Converted 0xFFFFFFFF to -1.
// Converted 0x080 to 128.
// Converted 0x0E293 to 58003.
// Converted 0x0F9A2FF to 16360191.
// Converted 0x0FFFFFFFF to 4294967295.
// Converted 0x0080 to 128.
// Converted 0x00E293 to 58003.
// Converted 0x00F9A2FF to 16360191.
// Converted 0x00FFFFFFFF to 4294967295.
Imports System.Globalization
Imports System.Numerics
Module Example
Public Sub Main()
Dim hexStrings() As String = { "80", "E293", "F9A2FF", "FFFFFFFF",
"080", "0E293", "0F9A2FF", "0FFFFFFFF",
"0080", "00E293", "00F9A2FF", "00FFFFFFFF" }
Dim number As BigInteger = BigInteger.Zero
For Each hexString As String In hexStrings
If BigInteger.TryParse(hexString, NumberStyles.AllowHexSpecifier,
Nothing, number) Then
Console.WriteLine("Converted 0x{0} to {1}.", hexString, number)
Else
Console.WriteLine("Cannot convert '{0}' to a BigInteger.", hexString)
End If
Next
End Sub
End Module
' The example displays the following output:
' Converted 0x80 to -128.
' Converted 0xE293 to -7533.
' Converted 0xF9A2FF to -417025.
' Converted 0xFFFFFFFF to -1.
' Converted 0x080 to 128.
' Converted 0x0E293 to 58003.
' Converted 0x0F9A2FF to 16360191.
' Converted 0x0FFFFFFFF to 4294967295.
' Converted 0x0080 to 128.
' Converted 0x00E293 to 58003.
' Converted 0x00F9A2FF to 16360191.
' Converted 0x00FFFFFFFF to 4294967295.
Il provider parametro è un'implementazione IFormatProvider . Il GetFormat metodo restituisce un NumberFormatInfo oggetto che fornisce informazioni specifiche delle impostazioni cultura sul formato di value. Il provider parametro può essere uno dei seguenti:
Oggetto CultureInfo che rappresenta le impostazioni cultura che forniscono informazioni di formattazione. Il GetFormat metodo restituisce l'oggetto NumberFormatInfo che fornisce informazioni sulla formattazione numerica per tali impostazioni cultura.
Oggetto NumberFormatInfo che fornisce informazioni sulla formattazione numerica. La sua implementazione di GetFormat restituisce solo se stessa.
Oggetto personalizzato che implementa IFormatProvider. Il GetFormat metodo crea un'istanza e restituisce l'oggetto NumberFormatInfo che fornisce informazioni di formattazione.
Se provider è null, viene utilizzato l'oggetto NumberFormatInfo per le impostazioni cultura correnti.
Vedi anche
Si applica a
TryParse(ReadOnlySpan<Char>, IFormatProvider, BigInteger)
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
- Origine:
- BigInteger.cs
Tenta di analizzare un intervallo di caratteri in un valore.
public:
static bool TryParse(ReadOnlySpan<char> s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Numerics::BigInteger % result) = ISpanParsable<System::Numerics::BigInteger>::TryParse;
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out System.Numerics.BigInteger result);
static member TryParse : ReadOnlySpan<char> * IFormatProvider * BigInteger -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), provider As IFormatProvider, ByRef result As BigInteger) As Boolean
Parametri
- s
- ReadOnlySpan<Char>
Intervallo di caratteri da analizzare.
- provider
- IFormatProvider
Oggetto che fornisce informazioni di formattazione specifiche delle impostazioni cultura su s.
- result
- BigInteger
Quando termina, questo metodo contiene il risultato dell'analisi scorretta di o di un valore non definito in caso di errore.
Restituisce
true se s è stato analizzato correttamente; in caso contrario, false.