Converts the specified string representation of a number to an equivalent 64-bit signed integer, using the specified culture-specific formatting information.
A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
Type Reason ArgumentNullException value is a null reference. FormatException value cannot be converted to a numeric value. OverflowException The numeric value of value is greater than long.MaxValue or less than long.MinValue.
The return value is the result of invoking the long.Parse(string) method on value.
provider is an IFormatProvider instance that obtains a System.Globalization.NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
If you prefer not to handle an exception if the conversion fails, you can call the long.TryParse(string, Int64@) method instead. It returns a bool value that indicates whether the conversion succeeded or failed.