NFloat.TryParse 方法

定義

多載

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, NFloat)

嘗試將UTF-8字元的範圍剖析為值。

TryParse(ReadOnlySpan<Byte>, NFloat)

嘗試將包含數位字串表示的UTF-8字元範圍轉換成其對等浮點數。

TryParse(ReadOnlySpan<Char>, NFloat)

嘗試將包含數位字串表示的字元範圍轉換為其相等的浮點數。

TryParse(String, NumberStyles, IFormatProvider, NFloat)

嘗試將指定樣式和特定文化特性格式的數位字串表示轉換為其相等的浮點數。

TryParse(String, NFloat)

嘗試將數位的字串表示轉換成其相等的浮點數。

TryParse(ReadOnlySpan<Char>, IFormatProvider, NFloat)

嘗試將字元範圍剖析成值。

TryParse(String, IFormatProvider, NFloat)

嘗試將字串剖析成值。

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, NFloat)

嘗試將包含指定樣式及特定文化特性格式之數位字串表示的字元範圍轉換為其相等的浮點數。

TryParse(ReadOnlySpan<Byte>, IFormatProvider, NFloat)

嘗試將UTF-8字元的範圍剖析為值。

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs

嘗試將UTF-8字元的範圍剖析為值。

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = System::Numerics::INumberBase<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), style As NumberStyles, provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

utf8Text
ReadOnlySpan<Byte>

要剖析的UTF-8字元範圍。

style
NumberStyles

數字樣式的位元組合,可以存在於 中 utf8Text

provider
IFormatProvider

提供關於 utf8Text 之特定文化特性格式資訊的物件。

result
NFloat

傳回時,包含成功剖析 utf8Text 或失敗時未定義值的結果。

傳回

true 如果 utf8Text 已成功剖析,則為 ,否則為 false

適用於

TryParse(ReadOnlySpan<Byte>, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs

嘗試將包含數位字串表示的UTF-8字元範圍轉換成其對等浮點數。

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result);
public static bool TryParse (ReadOnlySpan<byte> utf8Text, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<byte> * NFloat -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), ByRef result As NFloat) As Boolean

參數

utf8Text
ReadOnlySpan<Byte>

唯讀 UTF-8 字元範圍,其中包含要轉換的數位。

result
NFloat

當這個方法傳回時,如果轉換成功,則包含等於中所含數值或符號 utf8Text 的浮點數,如果轉換失敗,則為零。 如果 utf8TextEmpty 或 不是有效格式,轉換就會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。

傳回

如果 utf8Text 轉換成功,則為 true,否則為 false

適用於

TryParse(ReadOnlySpan<Char>, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將包含數位字串表示的字元範圍轉換為其相等的浮點數。

public:
 static bool TryParse(ReadOnlySpan<char> s, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result);
public static bool TryParse (ReadOnlySpan<char> s, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<char> * NFloat -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), ByRef result As NFloat) As Boolean

參數

s
ReadOnlySpan<Char>

唯讀字元範圍,其包含要轉換的數字。

result
NFloat

當這個方法傳回時,如果轉換成功,則包含等於中所含數值或符號 s 的浮點數,如果轉換失敗,則為零。 如果 sEmpty 或 不是有效格式,轉換就會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。

傳回

如果 s 轉換成功,則為 true,否則為 false

適用於

TryParse(String, NumberStyles, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將指定樣式和特定文化特性格式的數位字串表示轉換為其相等的浮點數。

public:
 static bool TryParse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = System::Numerics::INumberBase<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (string? s, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : string * System.Globalization.NumberStyles * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (s As String, style As NumberStyles, provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

s
String

唯讀字元範圍,其包含要轉換的數字。

style
NumberStyles

列舉值的位元組合,其表示 s 中可以存在的樣式項目。

provider
IFormatProvider

物件,其提供關於 s 的特定文化特性格式資訊。

result
NFloat

當這個方法傳回時,如果轉換成功,則包含等於中所含數值或符號 s 的浮點數,如果轉換失敗,則為零。 如果 snullEmpty、 或 的格式不符合 style,或者 style 如果 不是列舉常數的有效組合 NumberStyles ,則轉換會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。

傳回

如果 s 轉換成功,則為 true,否則為 false

例外狀況

style 不是 NumberStyles 值。

-或-

style 包含 AllowHexSpecifier 值。

適用於

TryParse(String, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將數位的字串表示轉換成其相等的浮點數。

public:
 static bool TryParse(System::String ^ s, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result);
public static bool TryParse (string? s, out System.Runtime.InteropServices.NFloat result);
static member TryParse : string * NFloat -> bool
Public Shared Function TryParse (s As String, ByRef result As NFloat) As Boolean

參數

s
String

唯讀字元範圍,其包含要轉換的數字。

result
NFloat

當這個方法傳回時,如果轉換成功,則包含等於中所含數值或符號 s 的浮點數,如果轉換失敗,則為零。 如果 snullEmpty或 不是有效格式,則轉換會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。

傳回

如果 s 轉換成功,則為 true,否則為 false

適用於

TryParse(ReadOnlySpan<Char>, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將字元範圍剖析成值。

public:
 static bool TryParse(ReadOnlySpan<char> s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = ISpanParsable<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<char> * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

s
ReadOnlySpan<Char>

要剖析的字元範圍。

provider
IFormatProvider

提供關於 s 之特定文化特性格式資訊的物件。

result
NFloat

當這個方法傳回時,會包含成功剖析 s的結果,或失敗時未定義的值。

傳回

true 如果 s 已成功剖析,則為 ,否則為 false

適用於

TryParse(String, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將字串剖析成值。

public:
 static bool TryParse(System::String ^ s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = IParsable<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (string? s, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : string * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (s As String, provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

s
String

要剖析的字串。

provider
IFormatProvider

提供關於 s 之特定文化特性格式資訊的物件。

result
NFloat

當這個方法傳回時,包含成功剖析 s 或失敗時未定義值的結果。

傳回

true 如果 s 已成功剖析,則為 ,否則為 false

適用於

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs
來源:
NFloat.cs

嘗試將包含指定樣式及特定文化特性格式之數位字串表示的字元範圍轉換為其相等的浮點數。

public:
 static bool TryParse(ReadOnlySpan<char> s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = System::Numerics::INumberBase<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), style As NumberStyles, provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

s
ReadOnlySpan<Char>

唯讀字元範圍,其包含要轉換的數字。

style
NumberStyles

列舉值的位元組合,其表示 s 中可以存在的樣式項目。

provider
IFormatProvider

物件,其提供關於 s 的特定文化特性格式資訊。

result
NFloat

當這個方法傳回時,如果轉換成功,則包含等於中所含數值或符號 s 的浮點數,如果轉換失敗,則為零。 如果 sEmpty 或的格式不符合 style,或 style 不是列舉常數的有效組合 NumberStyles ,則轉換會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。

傳回

如果 s 轉換成功,則為 true,否則為 false

例外狀況

style 不是 NumberStyles 值。

-或-

style 包含 AllowHexSpecifier 值。

適用於

TryParse(ReadOnlySpan<Byte>, IFormatProvider, NFloat)

來源:
NFloat.cs
來源:
NFloat.cs

嘗試將UTF-8字元的範圍剖析為值。

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider, [Runtime::InteropServices::Out] System::Runtime::InteropServices::NFloat % result) = IUtf8SpanParsable<System::Runtime::InteropServices::NFloat>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);
static member TryParse : ReadOnlySpan<byte> * IFormatProvider * NFloat -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider, ByRef result As NFloat) As Boolean

參數

utf8Text
ReadOnlySpan<Byte>

要剖析的UTF-8字元範圍。

provider
IFormatProvider

提供關於 utf8Text 之特定文化特性格式資訊的物件。

result
NFloat

傳回時,包含成功剖析 utf8Text 或失敗時未定義值的結果。

傳回

true 如果 utf8Text 已成功剖析,則為 ,否則為 false

適用於