str = "D5" if(str ~= nil)then print(tonumber(str,16)); end if(tonumber(str,16) >= 0x0 and tonumber(str,16) <= 0xFF and str ~= nil)then print("Right area"); else print("Wrong area"); end