- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 16进制字符串转原字符串
function myHextoStr(S: string): string; //16进制字符串转原字符串
var hexS,tmpstr:string;
i:integer;
a:byte;
begin
hexS :=s;//应该是该字符串
if length(hexS) mod 2=1 then
begin
hexS:=hexS+'0';
end;
tmpstr:='';
for i:=1 to (length(hexS) div 2) do
begin
a:=strtoint('$'+hexS[2*i-1]+hexS[2*i]);
tmpstr := tmpstr+chr(a);
end;
result :=tmpstr;
end;