convert vs parse vs cast c# code example

convert vs parse vs cast c#

1

1 Example

0
    [System.Security.SecuritySafeCritical]  // auto-generated 
    internal unsafe static Int64 ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) {
        Byte * numberBufferBytes = stackalloc Byte[NumberBuffer.NumberBufferBytes]; 
        NumberBuffer number = new NumberBuffer(numberBufferBytes); 
        Int64 i = 0;

        StringToNumber(value, options, ref number, numfmt, false);

        if ((options & NumberStyles.AllowHexSpecifier) != 0) {
            if (!HexNumberToInt64(ref number, ref i)) { 
                throw new OverflowException(Environment.GetResourceString("Overflow_Int64"));
            } 
        } 
        else {
            if (!NumberToInt64(ref number, ref i)) { 
                throw new OverflowException(Environment.GetResourceString("Overflow_Int64"));
            }
        }
        return i; 
    }
by on

Other Code Examples