System.Number.TryParseInt64 C# (CSharp) Method

TryParseInt64() static private method

static private TryParseInt64 ( String s, NumberStyles style, NumberFormatInfo info, Int64 &result ) : Boolean
s String
style NumberStyles
info NumberFormatInfo
result Int64
return Boolean
        internal unsafe static Boolean TryParseInt64(String s, NumberStyles style, NumberFormatInfo info, out Int64 result) {

            Byte * numberBufferBytes = stackalloc Byte[NumberBuffer.NumberBufferBytes];
            NumberBuffer number = new NumberBuffer(numberBufferBytes);
            result = 0;
    
            if (!TryStringToNumber(s, style, ref number, info, false)) {
                return false;
            }

            if ((style & NumberStyles.AllowHexSpecifier) != 0) {
                if (!HexNumberToInt64(ref number, ref result)) { 
                    return false;
                }
            }
            else {
                if (!NumberToInt64(ref number, ref result)) {
                    return false;
                }
            }
            return true;           
        }

Usage Example

示例#1
0
 public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out Int64 result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseInt64(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
All Usage Examples Of System.Number::TryParseInt64