SysUtilsStrPos (C++)

From Appmethod Code Examples
Jump to: navigation, search

Description

The following example uses two edit controls and a button on a form. When the button is clicked, the text in the first edit control is searched for inside the text in the second edit control.

Code

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  if (StrPos(Edit1->Text.c_str(), Edit2->Text.c_str()))
    ShowMessage("Substring found.");
  else
    ShowMessage("Substring not found.");
}

Uses