Complex.TryParse Method

Definition

Overloads

TryParse(String, NumberStyles, IFormatProvider, Complex)

Tries to parse a string into a value.

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

Tries to parse a span of characters into a value.

TryParse(String, IFormatProvider, Complex)

Tries to parse a string into a value.

TryParse(ReadOnlySpan<Char>, IFormatProvider, Complex)

Tries to parse a span of characters into a value.

TryParse(String, NumberStyles, IFormatProvider, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Tries to parse a string into a value.

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

Parameters

s
String

The string to parse.

style
NumberStyles

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

provider
IFormatProvider

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

result
Complex

On return, contains the result of succesfully parsing s or an undefined value on failure.

Returns

true if s was successfully parsed; otherwise, false.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

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

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Tries to parse a span of characters into a value.

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

Parameters

s
ReadOnlySpan<Char>

The span of characters to parse.

style
NumberStyles

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

provider
IFormatProvider

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

result
Complex

On return, contains the result of succesfully parsing s or an undefined value on failure.

Returns

true if s was successfully parsed; otherwise, false.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

TryParse(String, IFormatProvider, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Tries to parse a string into a value.

C#
public static bool TryParse(string? s, IFormatProvider? provider, out System.Numerics.Complex result);

Parameters

s
String

The string to parse.

provider
IFormatProvider

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

result
Complex

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 and other versions
Product Versions
.NET 7, 8, 9, 10

TryParse(ReadOnlySpan<Char>, IFormatProvider, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Tries to parse a span of characters into a value.

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

Parameters

s
ReadOnlySpan<Char>

The span of characters to parse.

provider
IFormatProvider

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

result
Complex

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 and other versions
Product Versions
.NET 7, 8, 9, 10