System.Number.ParseUInt64 C# (CSharp) Method

ParseUInt64() static private method

static private ParseUInt64 ( String value, NumberStyles options, NumberFormatInfo numfmt ) : UInt64
value String
options NumberStyles
numfmt NumberFormatInfo
return UInt64
        internal unsafe static UInt64 ParseUInt64(String value, NumberStyles options, NumberFormatInfo numfmt) {
            Byte * numberBufferBytes = stackalloc Byte[NumberBuffer.NumberBufferBytes];
            NumberBuffer number = new NumberBuffer(numberBufferBytes);
            UInt64 i = 0;

            StringToNumber(value, options, ref number, numfmt, false);
            if ((options & NumberStyles.AllowHexSpecifier) != 0) {
                if (!HexNumberToUInt64(ref number, ref i)) {
                    throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
                }
            }
            else {
                if (!NumberToUInt64(ref number, ref i)) {
                    throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
                }
            }
            return i;
        }

Usage Example

示例#1
0
        public static ulong Parse(String s, NumberStyles style, IFormatProvider provider)
        {
            NumberFormatInfo info = NumberFormatInfo.GetInstance(provider);

            NumberFormatInfo.ValidateParseStyle(style);
            return(Number.ParseUInt64(s, style, info));
        }
All Usage Examples Of System.Number::ParseUInt64