Прочетете на английски Редактиране

Споделяне чрез


NFloat.TryParse Method

Definition

Overloads

TryParse(ReadOnlySpan<Byte>, NFloat)

Tries to convert a UTF-8 character span containing the string representation of a number to its floating-point number equivalent.

TryParse(ReadOnlySpan<Char>, NFloat)

Tries to convert a character span containing the string representation of a number to its floating-point number equivalent.

TryParse(String, NFloat)

Tries to convert the string representation of a number to its floating-point number equivalent.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, NFloat)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<Char>, IFormatProvider, NFloat)

Tries to parse a span of characters into a value.

TryParse(String, IFormatProvider, NFloat)

Tries to parse a string into a value.

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

Tries to parse a span of UTF-8 characters into a value.

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

Tries to convert a character span containing the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

TryParse(String, NumberStyles, IFormatProvider, NFloat)

Tries to convert the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

TryParse(ReadOnlySpan<Byte>, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs

Tries to convert a UTF-8 character span containing the string representation of a number to its floating-point number equivalent.

C#
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out System.Runtime.InteropServices.NFloat result);

Parameters

utf8Text
ReadOnlySpan<Byte>

A read-only UTF-8 character span that contains the number to convert.

result
NFloat

When this method returns, contains a floating-point number equivalent of the numeric value or symbol contained in utf8Text if the conversion succeeded or zero if the conversion failed. The conversion fails if the utf8Text is Empty or is not in a valid format. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if utf8Text was converted successfully; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

TryParse(ReadOnlySpan<Char>, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to convert a character span containing the string representation of a number to its floating-point number equivalent.

C#
public static bool TryParse(ReadOnlySpan<char> s, out System.Runtime.InteropServices.NFloat result);

Parameters

s
ReadOnlySpan<Char>

A read-only character span that contains the number to convert.

result
NFloat

When this method returns, contains a floating-point number equivalent of the numeric value or symbol contained in s if the conversion succeeded or zero if the conversion failed. The conversion fails if the s is Empty or is not in a valid format. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

TryParse(String, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to convert the string representation of a number to its floating-point number equivalent.

C#
public static bool TryParse(string? s, out System.Runtime.InteropServices.NFloat result);

Parameters

s
String

A read-only character span that contains the number to convert.

result
NFloat

When this method returns, contains a floating-point number equivalent of the numeric value or symbol contained in s if the conversion succeeded or zero if the conversion failed. The conversion fails if the s is null, Empty, or is not in a valid format. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

TryParse(ReadOnlySpan<Byte>, IFormatProvider, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs

Tries to parse a span of UTF-8 characters into a value.

C#
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

utf8Text
ReadOnlySpan<Byte>

The span of UTF-8 characters to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about utf8Text.

result
NFloat

On return, contains the result of successfully parsing utf8Text or an undefined value on failure.

Returns

true if utf8Text was successfully parsed; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

TryParse(ReadOnlySpan<Char>, IFormatProvider, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to parse a span of characters into a value.

C#
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

s
ReadOnlySpan<Char>

The span of characters to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about s.

result
NFloat

When this method returns, contains the result of successfully parsing s, or an undefined value on failure.

Returns

true if s was successfully parsed; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

TryParse(String, IFormatProvider, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to parse a string into a value.

C#
public static bool TryParse(string? s, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

s
String

The string to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about s.

result
NFloat

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

true if s was successfully parsed; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

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

Source:
NFloat.cs
Source:
NFloat.cs

Tries to parse a span of UTF-8 characters into a value.

C#
public static bool TryParse(ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

utf8Text
ReadOnlySpan<Byte>

The span of UTF-8 characters to parse.

style
NumberStyles

A bitwise combination of number styles that can be present in utf8Text.

provider
IFormatProvider

An object that provides culture-specific formatting information about utf8Text.

result
NFloat

On return, contains the result of successfully parsing utf8Text or an undefined value on failure.

Returns

true if utf8Text was successfully parsed; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

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

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to convert a character span containing the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

C#
public static bool TryParse(ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

s
ReadOnlySpan<Char>

A read-only character span that contains the number to convert.

style
NumberStyles

A bitwise combination of enumeration values that indicate the style elements that can be present in s.

provider
IFormatProvider

An object that supplies culture-specific formatting information about s.

result
NFloat

When this method returns, contains a floating-point number equivalent of the numeric value or symbol contained in s if the conversion succeeded or zero if the conversion failed. The conversion fails if the s is Empty or is not in a format compliant with style, or if style is not a valid combination of NumberStyles enumeration constants. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Exceptions

style is not a NumberStyles value.

-or-

style includes the AllowHexSpecifier value.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

TryParse(String, NumberStyles, IFormatProvider, NFloat)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

Tries to convert the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

C#
public static bool TryParse(string? s, System.Globalization.NumberStyles style, IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result);

Parameters

s
String

A read-only character span that contains the number to convert.

style
NumberStyles

A bitwise combination of enumeration values that indicate the style elements that can be present in s.

provider
IFormatProvider

An object that supplies culture-specific formatting information about s.

result
NFloat

When this method returns, contains a floating-point number equivalent of the numeric value or symbol contained in s if the conversion succeeded or zero if the conversion failed. The conversion fails if the s is null, Empty, or is not in a format compliant with style, or if style is not a valid combination of NumberStyles enumeration constants. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Exceptions

style is not a NumberStyles value.

-or-

style includes the AllowHexSpecifier value.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10