先贴一个
function TForm1.daozhi(s: string):string;
var
str,tempstr:string;
i:integer;
strList:TstringList;
begin
tempstr:=s;
str:='';
strList:=TstringList.Create;
while pos(' ',tempstr)>0do
begin
strList.Add(copy(tempstr,1,pos(' ',tempstr)-1));
delete(tempstr,1,pos(' ',tempstr));
end;
strList.Add(copy(tempstr,1,length(tempstr)));
for i := strList.Count-1do
wnto 0do
begin
str:=str+' '+strList;
end;
Result:=str;
strList.Free;
end;