next up previous contents index
Next: StrRScan Up: Functions and procedures. Previous: StrPCopy

StrPos

   

Declaration:

Function StrPos (S1,S2 : PChar) : PChar;

Description:

Returns a pointer to the first occurrence of S2 in S1. If S2 does not occur in S1, returns Nil.

Errors:

None.

See also:

Pos (), StrScan, StrRScan

Example
Program Example15;

Uses strings;

{ Program to demonstrate the StrPos function. }

Const P : PChar = 'This is a PChar string.';
      S : Pchar = 'is';
begin
  Writeln ('Position of ''is'' in P : ',longint(StrPos(P,S))-Longint(P));
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998