Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
Program StringReplace;
|
||||
|
||||
uses
|
||||
Classes, StrUtils;
|
||||
|
||||
const
|
||||
fileName: array[1..3] of string = ('a.txt', 'b.txt', 'c.txt');
|
||||
matchText = 'Goodbye London!';
|
||||
replaceText = 'Hello New York!';
|
||||
|
||||
var
|
||||
AllText: TStringlist;
|
||||
i, j: integer;
|
||||
|
||||
begin
|
||||
for j := low(fileName) to high(fileName) do
|
||||
begin
|
||||
AllText := TStringlist.Create;
|
||||
AllText.LoadFromFile(fileName[j]);
|
||||
for i := 0 to AllText.Count-1 do
|
||||
AllText.Strings[i] := AnsiReplaceStr(AllText.Strings[i], matchText, replaceText);
|
||||
AllText.SaveToFile(fileName[j]);
|
||||
AllText.Destroy;
|
||||
end;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue