var
s,s1:string;
len:integer;
i:Integer;
begin
s:='11.22*3.88*5.6-1';
s1:='';
len:=Length(s);
for i:=1 to len do
begin
if (s<>'*') and (s<>'-') then
s1:=s1+s
else if s= '*' then
s1:=s1+' '
else if s='-' then
break;
end;
Edit1.Text:=s1;
end;
可以改用Memo输出
var
s,s1:string;
len:integer;
i:Integer;
begin
s:='11.22*3.88*5.6-1';
s1:='';
len:=Length(s);
for i:=1 to len do
begin
if (s<>'*') and (s<>'-') then
s1:=s1+s
else if s= '*' then
begin
Memo1.Lines.Add(s1);
s1:='';
end
else if s='-' then
begin
Memo1.Lines.Add(s1);
break;
end;
end;
end;