System.Number.ParseUInt32 C# (CSharp) Method

ParseUInt32() static private method

static private ParseUInt32 ( String value, NumberStyles options, NumberFormatInfo numfmt ) : UInt32
value String
options NumberStyles
numfmt NumberFormatInfo
return UInt32
        internal unsafe static UInt32 ParseUInt32(String value, NumberStyles options, NumberFormatInfo numfmt) {

            Byte * numberBufferBytes = stackalloc Byte[NumberBuffer.NumberBufferBytes];
            NumberBuffer number = new NumberBuffer(numberBufferBytes);
            UInt32 i = 0;
        
            StringToNumber(value, options, ref number, numfmt, false);

            if ((options & NumberStyles.AllowHexSpecifier) != 0) {
                if (!HexNumberToUInt32(ref number, ref i)) {
                    throw new OverflowException(Environment.GetResourceString("Overflow_UInt32"));
                }
            }
            else {
                if (!NumberToUInt32(ref number, ref i)) {
                    throw new OverflowException(Environment.GetResourceString("Overflow_UInt32"));
                }
            }
    
            return i;
        }

Usage Example

示例#1
0
 public static uint Parse(string s)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo));
 }
All Usage Examples Of System.Number::ParseUInt32