Весь код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Str : string;
Rep : string;
i : integer;
begin
Label1.Caption := 'Enter text';
Edit1.Text := Str;
Label2.Caption := 'ReplaceChars';
Edit2.Text := Rep;
for i:=1 to Length(Rep) do
Str := StringReplace(Str, AnsiUpperCase(Rep[i]), Rep[i]), [rfReplaceAll]);
label3.Caption := Str;
end;
end.