现在的位置: 首页 > 综合 > 正文

字符串转换成16进制字符串

2011年03月27日 ⁄ 综合 ⁄ 共 205字 ⁄ 字号 评论关闭
function StrToHexStr(const S:string):string;
//字符串转换成16进制字符串
var
  I:Integer;
begin
  for I:=1 to Length(S) do
  begin
    if I=1 then
      Result:=IntToHex(Ord(S[1]),2)
    else Result:=Result+' '+IntToHex(Ord(S[I]),2);
  end;
end;

抱歉!评论已关闭.