while Pos(#13#10#13#10, Memo1.Text) > 0 do Memo1.Text := StringReplace(Memo1.Text, #13#10#13#10, #13#10, [rfReplaceAll]); //or var I: Integer; begin with Memo1.Lines do begin BeginUpdate; try for I := Count - 1 downto 0 do if Strings[I] = '' then Delete(I); finally EndUpdate; end; end; end;
for i:=memo.lines.count-1 do 0 do begin if (Trim(Memo.lines[i])=EmptyStr then Memo.Delete[i]; Inc(i); end;我这里没有delphi,但愿没有写错吧...
for i:=memo.lines.count-1 downto 0 do begin if (Trim(Memo.lines[i])=EmptyStr then Memo.Delete[i]; Inc(i); Application.ProcessMessage; end;
Memo1.Text := StringReplace(Memo1.Text, #13#10#13#10, #13#10, [rfReplaceAll]);
//or
var
I: Integer;
begin
with Memo1.Lines do
begin
BeginUpdate;
try
for I := Count - 1 downto 0 do
if Strings[I] = '' then Delete(I);
finally
EndUpdate;
end;
end;
end;
begin
if (Trim(Memo.lines[i])=EmptyStr then
Memo.Delete[i];
Inc(i);
end;我这里没有delphi,但愿没有写错吧...
begin
if (Trim(Memo.lines[i])=EmptyStr then
Memo.Delete[i];
Inc(i);
Application.ProcessMessage;
end;