之前D7寫桌面程式中用到HexStrToStr和strtohexstr兩個函式
function HexStrToStr(const S:string):string;
//16進制字串轉換成字串
var
t:Integer;
ts:string;
M,Code:Integer;
begin
t:=1;
Result:='';
while t<=Length(S) do
begin
while not (S[t] in ['0'..'9','A'..'F','a'..'f']) do
inc(t);
if (t+1>Length(S))or(not (S[t+1] in ['0'..'9','A'..'F','a'..'f'])) then
ts:='$'+S[t]
else
ts:='$'+S[t]+S[t+1];
Val(ts,M,Code);
if Code=0 then
Result:=Result+Chr(M);
inc(t,2);
end;
end;
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;
現在想在安卓中應該怎么寫才能使用
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/63088.html
標籤:語言基礎/算法/系統設計
上一篇:指標相關問題求助
下一篇:實作電腦上輸入電話號碼,直接撥號
