function IsSubStr(a, b : PChar) : Boolean;
begin
Result := True;
While True Do
begin
if (Pos(a^, b)=0) Then
begin
Result := False;
Break;
end;
inc(a);
if (a^ In [#0]) then break;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
If IsSubStr('246', '2345679') Then Edit1.Text := 'True'
else Edit1.Text := 'False';
end;