BitOrchestra.Parser.IsHexadecimalDigit C# (CSharp) Method

IsHexadecimalDigit() public static method

Determines wether the given character is a hexadecimal digit, if so, returns its value.
public static IsHexadecimalDigit ( char Char, int &Value ) : bool
Char char
Value int
return bool
        public static bool IsHexadecimalDigit(char Char, ref int Value)
        {
            int i = (int)Char;
            if (i >= 48 && i <= 57)
            {
                Value = i - 48;
                return true;
            }
            if (i >= 65 && i <= 70)
            {
                Value = i - 65 + 10;
                return true;
            }
            if (i >= 97 && i <= 102)
            {
                Value = i - 97 + 10;
                return true;
            }
            return false;
        }