UInt32::Parse Method (String)
Converts the string representation of a number to its 32-bit unsigned integer equivalent.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- s
- Type: System::String
A string representing the number to convert.
| Exception | Condition |
|---|---|
| ArgumentNullException | The s parameter is nullptr. |
| FormatException | The s parameter is not of the correct format. |
| OverflowException | The s parameter represents a number that is less than UInt32::MinValue or greater than UInt32::MaxValue. |
The s parameter should be the string representation of a number in the following form.
[ws][sign]digits[ws]
Elements in square brackets ([ and ]) are optional. The following table describes each element.
Element | Description |
|---|---|
ws | Optional white space. |
sign | An optional sign. Valid sign characters are determined by the NumberFormatInfo::NegativeSign and NumberFormatInfo::PositiveSign properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an OverflowException. |
digits | A sequence of digits ranging from 0 to 9. Any leading zeros are ignored. |
Note |
|---|
The string specified by the s parameter is interpreted by using the NumberStyles::Integer style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. |
The s parameter is parsed by using the formatting information in a System.Globalization::NumberFormatInfo object that is initialized for the current system culture. For more information, see NumberFormatInfo::CurrentInfo. To parse a string by using the formatting information of a specific culture, use the Parse(String, IFormatProvider) method.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note