SysUtilsStrPos (Object Pascal)

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 in the second edit control.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  if StrPos(PChar(Edit1.Text), PChar(Edit2.Text)) <> nil then
    ShowMessage('Substring found')
  else
    ShowMessage('Substring not found');
end;

Uses