我又试了一下,StrToInt(S)不能将十六进制数转换到字符型,是不是delphi 的帮助文件写错了? 这是它的原文: function StrToInt(const S: string): Integer;DescriptionStrToInt converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt raises an EConvertError exception.
BinToStr(IntToBin(i)),反过来就是StrToInt(S)此时,s可以为二进制或十六进制的字符串,都可以的(具体是什么形式的我也不知道,从帮助文件中查的)取字符串前X个字符:function LeftStr(const AText: string; ACount: Integer): string;中间: copy(String,Astart,ALength),
最后X个:RightStr(st: String; Len: Integer): String;
这是它的原文:
function StrToInt(const S: string): Integer;DescriptionStrToInt converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt raises an EConvertError exception.