var tmpstr1,tmpstr2 : string; n : integer; begin tempstr := 'asdfadsf'; n := length(tempstr); tmpstr2 := copy(tempstr,(n-2),2); end;
Returns a substring of a string or a segment of a dynamic array.UnitSystemCategorystring handling routinesfunction Copy(S; Index, Count: Integer): string; function Copy(S; Index, Count: Integer): array;
var str1,str1:string; begin str1:='1234'; str2:=copy(str1,length(trim(str1))-2,2); end;
tmpstr1,tmpstr2 : string;
n : integer;
begin
tempstr := 'asdfadsf';
n := length(tempstr);
tmpstr2 := copy(tempstr,(n-2),2);
end;
function Copy(S; Index, Count: Integer): array;
str1,str1:string;
begin
str1:='1234';
str2:=copy(str1,length(trim(str1))-2,2);
end;
搞定,接分!