showmessage( inttohex(strtoint('$'+'1ac'),5))
你的这些字符只限于16进制就可以这样

解决方案 »

  1.   

    var S: string;begin
      S := '   123.5';
      { Convert spaces to zeroes }
      while Pos(' ', S) > 0 do
        S[Pos(' ', S)] := '0';
    end;
    用pos吧!
      

  2.   

    var S: string;begin
      S := '   123.5';
      { 把空格变成零!}
      while Pos(' ', S) > 0 do
        S[Pos(' ', S)] := '0';
    end;
      

  3.   

    FORMAT就行还用编程吗?奇怪。
      

  4.   

    WHILE Length(YourString)<5 do YourString:='0'+YourString;
    方法是土了点儿,不过还算使用。能用Format直接做到吗?
      

  5.   

    WHILE Length(YourString)<5 do YourString:='0'+YourString;
    方法是土了点儿,不过还算实用。能用Format直接做到吗?
      

  6.   

    n:=1AC;
    s:=Format('%5.5d',[n]);
    行的话请给分
      

  7.   

    打错了,应该是
    n:=1AC;
    s:=Format('%5.5x',[n]);
    行的话请给分  
      

  8.   

    楼上的,x已经转换了
    如果是整数的可以用:
    format('%0.5d',[123]);
      

  9.   

    Copy('00000000',0,Length(sourcestring))+sourcestring)
      

  10.   

    Copy('00000000',0,Length(sourcestring))+sourcestring)
      

  11.   

    我试过了,可行
    n:=$1AC;
    s:=Format('%5.5x',[n]);
      

  12.   

    S := FormatFloat('00000', 123)
    // S := '00123'
      

  13.   

    格式化输出数字形字符
    S := FormatFloat('###,###.##', 223434.34)
      

  14.   

    应该行
    n:=$1AC;
    s:=Format('%5.5x',[n]);
      

  15.   

    又打错了
    n:=$1AC;
    s:=Format('$%5.5x',[n]);
    //s='$001AC'