Converts a String representation of a value to a UInt64. The UInt64 type is not CLS compliant. The CLS-compliant alternative is Int64.
[C#] public static ulong Parse( string s, NumberStyles style ); [C++] public: static unsigned __int64 Parse( String* s, NumberStyles style ); [JScript] public static function Parse( s : String, style : NumberStyles ) : UInt64;
[Visual Basic] The UInt64 type cannot be used in Visual Basic.
A UInt64 with the value represented by s.
Exception Type | Condition |
---|---|
ArgumentException | If style is not a NumberStyles enumeration. |
ArgumentException | If the string is a null reference (in Visual Basic Nothing). |
FormatException | If the string contains a character other than the minus sign ("-") or the digits 0 through 9. |
OverflowException | If the string represents a number that is less than MinValue or greater than MaxValue. |
If s has been created by one of the Format methods using C, D, E, F, G, or N as the format specifier, s can be parsed when style is NumberStyles enumeration.
The style parameter specifies the permitted style of the numeric string. It must be a combination of bit flags from the NumberStyles enumeration. The numeric format information is obtained from the current locale (see NumberFormatInfo and CultureInfo for more information on numeric and culture formats).
The style must be a combination of bit flags from the NumberStyles enumeration.
Note Hexadecimal strings ("0x42") are not supported. Use Value or Convert ToIntxx(string, int) and ToUIntxx methods for the conversions.
Note The Parse methods do not accept not a number (NaN) or positive or negative infinity.
UInt64 Structure | UInt64 Members | System Namespace | UInt64.Parse Overload List | String | MaxValue | MinValue | Value | Convert | NaN | NaN | PositiveInfinity | PositiveInfinity | NegativeInfinity | NegativeInfinity