Struct UInt32
Represents a 32-bit ununsigned integer.
Inherited Members
Namespace: System
Assembly: mscorlib.dll
Syntax
[CLSCompliant(false)]
public struct UInt32
Fields
| Improve this Doc View SourceMaxValue
Represents the largest possible value of UInt32. This field is constant.
Declaration
public const uint MaxValue = 4294967295U
Field Value
Type | Description |
---|---|
UInt32 |
Remarks
The value of this constant is 4,294,967,295; that is, hexadecimal 0xFFFFFFFF.
MinValue
Represents the smallest possible value of UInt32. This field is constant.
Declaration
public const uint MinValue = 0U
Field Value
Type | Description |
---|---|
UInt32 |
Remarks
The value of this constant is 0.
Methods
| Improve this Doc View SourceParse(String)
Converts the string representation of a number to its 32-bit unsigned integer equivalent.
Declaration
[CLSCompliant(false)]
public static uint Parse(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | A string representing the number to convert. |
Returns
Type | Description |
---|---|
UInt32 | A 32-bit unsigned integer equivalent to the number contained in s. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToString()
Converts the numeric value of this instance to its equivalent string representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
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. |
Overrides
| Improve this Doc View SourceToString(String)
Converts the numeric value of this instance to its equivalent string representation using the specified format.
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
String | format | A numeric format string. |
Returns
Type | Description |
---|---|
String | The string representation of the value of this instance as specified by format. |
TryParse(String, out UInt32)
Converts the string representation of a number to its 32-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded.
Declaration
public static bool TryParse(string s, out uint result)
Parameters
Type | Name | Description |
---|---|---|
String | s | Converts the string representation of a number to its 32-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded. |
UInt32 | result | When this method returns, contains the 32-bit unsigned integer value equivalent of the number contained in |
Returns
Type | Description |
---|---|
Boolean | true if s was converted successfully; otherwise, false. |
Remarks
The TryParse(String, out UInt32) method is like the Parse(String) method, except the TryParse(String, out UInt32) 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.