同上
Edit1->Text.pos("x")
用.Pos("a"),没有则返回-1
strchr(s1,c);
查找字符串s1中是否有字符c,若有,返回出现的指针,没有返回NULL
楼上的不对吧,返回0;
AnsiPos("a"); //含有字符a则>0 ,没有则=0 ,和Pos也一样
至于两者的区别查看help,一目了然了.
这样的:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString ch="abcd" ;
int x=ch.Pos("c");//x为某個字符如c在字符串中的第一个位置
ShowMessage(IntToStr(x));
}
memchr()
strchr()
看看帮助