function stringreplace1(s: string
s1,s2: array of string ): string;
var i: word;
begin
for i:=0 to length(s1)-1 do
s:=stringreplace(s,s1,s2,[rfReplaceAll]);
result:=s;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(stringreplace1('AAABBB',['A','B'],['a','b']));
end;