unit SysUtilsStrPos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SysUtilsStrPos

// Routine: SysUtils.StrPos

// BeginCode
{
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 the text in the second edit control.
}
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;
// EndCode
// EndExample: SysUtilsStrPos
end.
