<!--CodeS-->
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
s : string;
begin
for i:=0 to Pred(TreeView1.Items.Count) do begin
s := TreeView1.Items.Item[i].Text;
while Pos('a', s) > 0 do
s[Pos('a', s)] := 'p';
while Pos('b', s) > 0 do
s[Pos('b', s)] := 'o';
TreeView1.Items.Item[i].Text := s;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
s : string;
begin
for i:=0 to Pred(TreeView1.Items.Count) do begin
s := TreeView1.Items.Item[i].Text;
while Pos('a', s) > 0 do
s[Pos('a', s)] := 'p';
while Pos('b', s) > 0 do
s[Pos('b', s)] := 'o';
TreeView1.Items.Item[i].Text := s;
end;
end;
<!--CodeE-->