Int64Static: Parse

Parse

Converts the string representation of a number to its 64-bit signed integer equivalent.



 Public Function Parse(
	  ByRef s As String ) As Int64

Parameters

s
[ByRef] String. A string containing a number to convert.

Return Values

Int64 -  A 64-bit signed integer equivalent to the number contained in s.

Remarks

The s parameter contains a number of the form:

[ws][sign]digits[ws]

Elements in square brackets ([ and ]) are optional. The following table describes each element.

Element Description
wsOptional white space.
signAn optional sign.
digitsA sequence of digits ranging from 0 to 9.

The s parameter is interpreted using the NumberStyles.Integer style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in s, use Int64.ParseEx(String, NumberStyles) or the Int64.Parse(String, NumberStyles, IFormatProvider) method.

A string expression beginning with "0x" or "&h" will be parsed as a hex value.

Exceptions

ExceptionCondition
FormatException s is not in the correct format.
OverflowException s represents a number less than MinValue or greater than MaxValue.

See Also

Project CorLib Overview

Class Int64Static Overview

ParseEx

TryParse

TryParseEx