BigInteger.Parse Method

Definition

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

Overload List

Parse(String) Converts the string representation of a number to its BigInteger equivalent.
Parse(ReadOnlySpan<Char>, IFormatProvider)Parses a span of characters into a value.
Parse(String, NumberStyles) Converts the string representation of a number in a specified style to its BigInteger equivalent.
Parse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its BigInteger equivalent.
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)Parses a span of characters into a value.
Parse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its BigInteger equivalent.

Parse(String)

Converts the string representation of a number to its BigInteger equivalent.
C#
public static BigInteger Parse(
	string s
)

Parameters

s  String
A string containing a number to convert.

Return Value

BigInteger
A BigInteger equivalent to the numeric s or symbol specified in s.

Exceptions

ArgumentNullException

s is null.

FormatException

s is not a number in a valid format.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Parses a span of characters into a value.
C#
public static BigInteger Parse(
	ReadOnlySpan<char> s,
	IFormatProvider? provider
)

Parameters

s  ReadOnlySpan<Char>
The span of characters to parse.
provider  IFormatProvider
An object that provides culture-specific formatting information about s.

Return Value

BigInteger
The result of parsing s.

Implements

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

Exceptions

FormatExceptions is not in the correct format.
OverflowExceptions is not representable by TSelf.

Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its BigInteger equivalent.
C#
public static BigInteger Parse(
	string s,
	NumberStyles style
)

Parameters

s  String
A string containing a number to convert.
style  NumberStyles
A bitwise combination of NumberStyles values that indicates the permitted format of s.

Return Value

BigInteger
A BigInteger equivalent to the numeric s or symbol specified in s.

Exceptions

ArgumentNullException

s is null.

FormatException

s is not a number in a valid format.

Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its BigInteger equivalent.
C#
public static BigInteger Parse(
	string s,
	IFormatProvider? provider
)

Parameters

s  String
A string containing a number to convert.
provider  IFormatProvider
An IFormatProvider that supplies culture-specific formatting information about s.

Return Value

BigInteger
A BigInteger equivalent to the numeric s or symbol specified in s.

Implements

IParsable<TSelf>.Parse(String, IFormatProvider)

Exceptions

ArgumentNullException

s is null.

FormatException

s is not a number in a valid format.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Parses a span of characters into a value.
C#
public static BigInteger Parse(
	ReadOnlySpan<char> s,
	NumberStyles style,
	IFormatProvider? provider
)

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.

Return Value

BigInteger
The result of parsing s.

Implements

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

Exceptions

ArgumentExceptionstyle is not a supported NumberStyles value.
FormatExceptions is not in the correct format.
OverflowExceptions is not representable by TSelf.

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number in a specified style and culture-specific format to its BigInteger equivalent.
C#
public static BigInteger Parse(
	string s,
	NumberStyles style,
	IFormatProvider? provider
)

Parameters

s  String
A string containing a number to convert.
style  NumberStyles
A bitwise combination of NumberStyles values that indicates the permitted format of s.
provider  IFormatProvider
An IFormatProvider that supplies culture-specific formatting information about s.

Return Value

BigInteger
A BigInteger equivalent to the numeric s or symbol specified in s.

Implements

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

Exceptions

ArgumentNullException

s is null.

FormatException

s is not a number in a valid format.

See Also