RTools.Util.IntToken.ParseHex C# (CSharp) Method

ParseHex() public static method

Parse a string known to be a hex string. This is faster than Parse which doesn't assume the number is Hex. This will throw an exception if the input number isn't hex.
public static ParseHex ( string s, int lineNumber ) : IntToken
s string The hex number as a string.
lineNumber int The line where this token was found.
return IntToken
        public static IntToken ParseHex(string s, int lineNumber)
        {
            IntToken it = null;
            try
            {
                it = new IntToken(Convert.ToInt32(s, 16), lineNumber);
            }
            catch
            {
                it = new IntToken(Convert.ToInt64(s, 16), lineNumber);
            }

            return (it);
        }