Dev2.Converters.Dev2HexConverter.IsType C# (CSharp) Method

IsType() public method

public IsType ( string payload ) : bool
payload string
return bool
        public bool IsType(string payload)
        {
            bool result = Regex.IsMatch(payload, @"\A\b[0-9a-fA-F]+\b\Z") ||
                          Regex.IsMatch(payload, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z");

            if (payload.Length%2 != 0)
            {
                result = false;
            }
            return result;
        }