Int64Parse Method (String, NumberStyles) |
Converts the string representation of a number in a specified style to its 64-bit signed integer equivalent.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static long Parse(
string s,
NumberStyles style
)
Parameters
- s
- Type: SystemString
A string containing a number to convert. - style
- Type: System.GlobalizationNumberStyles
A bitwise combination of NumberStyles values that indicates the permitted format of s. A typical value to specify is Integer.
Return Value
Type:
Int64A 64-bit signed integer equivalent to the number specified in
s.
Exceptions Exception | Condition |
---|
ArgumentNullException | s is null. |
ArgumentException | style is not a NumberStyles value. -or-style is not a combination of AllowHexSpecifier and HexNumber values. |
FormatException | s is not in a format compliant with style. |
OverflowException | s represents a number less than MinValue or greater than MaxValue.-or-style supports fractional digits but s includes non-zero fractional digits. |
See Also