По нажатию на кнопку?
вот как получилось
Сама процедура:
procedure TForm1.Button1Click(Sender: TObject);
var
s,p:string;
i,n: byte;
begin
s:=edit1.text;
n:=length(s);
for i:=1 to n do begin
if s[i]=inttostr(1) then
Delete(s,i,1);
end;
edit1.text:=s; ShowMessage('S теперь : '+s);
end;