Complex<T>.TryParse Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3

Overload List

TryParse(ReadOnlySpan<Char>, IFormatProvider, Complex<T>)Tries to parse a span of characters into a value.
TryParse(String, IFormatProvider, Complex<T>)Tries to parse a string into a value.
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Complex<T>)Tries to parse a span of characters into a value.
TryParse(String, NumberStyles, IFormatProvider, Complex<T>)Tries to parse a string into a value.

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

Tries to parse a span of characters into a value.
C#
public static bool TryParse(
	ReadOnlySpan<char> s,
	IFormatProvider? provider,
	out Complex<T> 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<T>
When this method returns, contains the result of successfully parsing s, or an undefined value on failure.

Return Value

Boolean
true if s was successfully parsed; otherwise, false.

Implements

ISpanParsable<TSelf>.TryParse(ReadOnlySpan<Char>, IFormatProvider, TSelf)

TryParse(String, IFormatProvider, Complex<T>)

Tries to parse a string into a value.
C#
public static bool TryParse(
	string s,
	IFormatProvider? provider,
	out Complex<T> result
)

Parameters

s  String
The string to parse.
provider  IFormatProvider
An object that provides culture-specific formatting information about s.
result  Complex<T>
When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Return Value

Boolean
true if s was successfully parsed; otherwise, false.

Implements

IParsable<TSelf>.TryParse(String, IFormatProvider, TSelf)

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

Tries to parse a span of characters into a value.
C#
public static bool TryParse(
	ReadOnlySpan<char> s,
	NumberStyles style,
	IFormatProvider? provider,
	out Complex<T> 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<T>
On return, contains the result of succesfully parsing s or an undefined value on failure.

Return Value

Boolean
true if s was successfully parsed; otherwise, false.

Implements

INumberBase<TSelf>.TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, TSelf)

Exceptions

ArgumentExceptionstyle is not a supported NumberStyles value.

TryParse(String, NumberStyles, IFormatProvider, Complex<T>)

Tries to parse a string into a value.
C#
public static bool TryParse(
	string s,
	NumberStyles style,
	IFormatProvider? provider,
	out Complex<T> 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<T>
On return, contains the result of succesfully parsing s or an undefined value on failure.

Return Value

Boolean
true if s was successfully parsed; otherwise, false.

Implements

INumberBase<TSelf>.TryParse(String, NumberStyles, IFormatProvider, TSelf)

Exceptions

ArgumentExceptionstyle is not a supported NumberStyles value.

See Also