Struct ulong
- Namespace
- System
- Assembly
- mscorlib.dll
Represents a 64-bit ununsigned integer.
[CLSCompliant(false)]
public ulong
- Inherited Members
Fields
MaxValue
Represents the largest possible value of UInt64. This field is constant.
public const ulong MaxValue = 18446744073709551615
Field Value
Remarks
The value of this constant is 18,446,744,073,709,551,615; that is, hexadecimal 0xFFFFFFFFFFFFFFFF.
MinValue
Represents the smallest possible value of UInt64. This field is constant.
public const ulong MinValue = 0
Field Value
Remarks
The value of this constant is 0.
Methods
Parse(string)
Converts the string representation of a number to its 64-bit unsigned integer equivalent.
[CLSCompliant(false)]
public static ulong Parse(string s)
Parameters
s
stringA string that represents the number to convert.
Returns
- ulong
A 64-bit unsigned integer equivalent to the number contained in s.
Exceptions
- ArgumentNullException
s
is null.
ToString()
Converts the numeric value of this instance to its equivalent string representation.
public override string ToString()
Returns
- string
The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9, without a sign or leading zeroes.
ToString(string)
Converts the numeric value of this instance to its equivalent string representation using the specified format.
public string ToString(string format)
Parameters
format
stringA numeric format string.
Returns
- string
The string representation of the value of this instance as specified by format.
TryParse(string, out ulong)
Converts the string representation of a number to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded.
public static bool TryParse(string s, out ulong result)
Parameters
s
stringConverts the string representation of a number to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded.
result
ulongWhen this method returns, contains the 64-bit unsigned integer value equivalent of the number contained in
s
, if the conversion succeeded, or zero if the conversion failed. The conversion fails if thes
parameter is null or Empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.
Returns
Remarks
The TryParse(string, out ulong) method is like the Parse(string) method, except the TryParse(string, out ulong) method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a FormatException in the event that s
is invalid and cannot be successfully parsed.