Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- AnsiString ss1,ss2;
- int ll,nn;
- ss1=Edit1->Text;
- ss2="";
- for(;;)
- {
- nn=ss1.Length();
- if(nn<=0)break;
- ll = strcspn(ss1.c_str(),Edit2->Text.c_str());
- if(ll==0)ss1=ss1.SubString(2,nn-1);
- else
- {
- ss2=ss2+ss1.SubString(1,ll);
- ss1=ss1.SubString(ll+1,nn-ll);
- }
- }
- Edit3->Text=ss2;
- }
- //---------------------------------------------------------------------------
-