Das hier ist auf jeden Fall schneller:
Delphi-Quellcode:
try
List.LoadFromFile(FFileName);
Dumplist := List.Text;
iCount := 1;
iLength := Length(Dumplist);
Dumplist2 := '';
while iCount <= iLength do
begin
case Dumplist[iCount] of
'[':
if (iCount < iLength) and (Dumplist[iCount+1] = '[') then
Inc(iCount)
else
Dumplist2 := Dumplist2 + DumpList[iCount];
']':
if (iCount < iLength) and (Dumplist[iCount+1] = ']') then
Inc(iCount)
else
Dumplist2 := Dumplist2 + DumpList[iCount];
'\':
if (iCount < iLength) then
case DumpList[iCount+1] of
'n': Inc(iCount);
'''': Inc(iCount);
else
Dumplist2 := Dumplist2 + DumpList[iCount];
end;
else
Dumplist2 := Dumplist2 + DumpList[iCount];
end;
Inc(iCount);
end;
List.Text := Dumplist2;
List.SaveToFile(FFileName2);
finally
FreeAndNil(List);
end;