procedure TForm1.Button1Click(Sender: TObject);
begin with Edit1 do beginif Indexof('abc')>-1 thenDelete (Indexof('abc'));end;
end;
begin with Edit1 do beginif Indexof('abc')>-1 thenDelete (Indexof('abc'));end;
end;
解决方案 »
- 怎样把搜索到得数据保存在变量里
- 高效方便实用的远程数据库对象--以一起来学习
- 好像在yahoo里有个imageen的组,有谁知道地址吗?
- 一个关于数据库应用程序的问题
- △▲△ SOHU与SINA的差异!△▲△
- 如果这故事是真的,大家就帮帮她!
- 为什么wordpad.exe不能打开"我的文档"中的文本文件?
- 关于activemove(QuartzTypeLib_TLB)方面的问题
- 清空回收站的问题
- 请问李维新书《DELPHI 5 ADO/MTS/COM+》中的第三章第一节处理多个表JOIN出来的数据,有谁试过
- DLPHI最基本的問題。。。請幫忙
- “[ODBC]{Microsoft ACCESS]驱动 参数1 是什么错?
[Error] Unit1.pas(40): Statement expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
要实现你的要求可以这样
Edit1.Text:=StringReplace(Edit1.Text,'abc','',[rfReplaceAll]);
begin edit1.Clear;end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
s: String;
begin
if Edit1.Text<>'' then
begin
s:= Edit1.Text;
i:= pos('abc', Edit1.Text);
if i<>0 then
Delete(s, i, 3);
Edit1.Text:= s;
end;
end;