I have a hexadecimal string value. I want to convert it to an integer.
function HexStrToInt(const str: string): Integer;
begin
Result := ??;
end;
such that HexStrToInt('22')
, for example, returns 34
.
I have a hexadecimal string value. I want to convert it to an integer.
function HexStrToInt(const str: string): Integer;
begin
Result := ??;
end;
such that HexStrToInt('22')
, for example, returns 34
.
Perhaps the simplest is to do this:
function HexStrToInt(const str: string): Integer;
begin
Result := StrToInt('$' + str);
end;