| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
Search for substring in a string.
Source position: systemh.inc line 1166
function Pos(  | 
const substr: shortstring;  | 
const s: shortstring;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
C: Char;  | 
const s: shortstring;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const Substr: ShortString;  | 
const Source: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const substr: shortstring;  | 
c: Char;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const Substr: RawByteString;  | 
const Source: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: AnsiChar;  | 
const s: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const Substr: UnicodeString;  | 
const Source: UnicodeString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: Char;  | 
const s: UnicodeString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: UnicodeChar;  | 
const s: UnicodeString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: RawByteString;  | 
const s: UnicodeString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: UnicodeString;  | 
const s: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: ShortString;  | 
const s: UnicodeString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const Substr: WideString;  | 
const Source: WideString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: Char;  | 
const s: WideString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: WideChar;  | 
const s: WideString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: WideChar;  | 
const s: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: RawByteString;  | 
const s: WideString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: WideString;  | 
const s: RawByteString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
const c: ShortString;  | 
const s: WideString;  | 
Offset: SizeInt = 1  | 
):SizeInt;  | 
c: Char;  | 
const v: Variant  | 
):SizeInt;  | 
s: ShortString;  | 
const v: Variant  | 
):SizeInt;  | 
const a: AnsiString;  | 
const v: Variant  | 
):SizeInt;  | 
const w: WideString;  | 
const v: Variant  | 
):SizeInt;  | 
const w: UnicodeString;  | 
const v: Variant  | 
):SizeInt;  | 
const v: Variant;  | 
const c: Char  | 
):SizeInt;  | 
const v: Variant;  | 
const s: ShortString  | 
):SizeInt;  | 
const v: Variant;  | 
const a: AnsiString  | 
):SizeInt;  | 
const v: Variant;  | 
const w: WideString  | 
):SizeInt;  | 
const v: Variant;  | 
const w: UnicodeString  | 
):SizeInt;  | 
const v1: Variant;  | 
const v2: Variant  | 
):SizeInt;  | 
Pos returns the index of Substr in S, if S contains Substr. In case Substr isn't found, 0 is returned. The search is case-sensitive.
None
  | 
Returns length of a string or array.  | 
|
  | 
Copy part of a string.  | 
|
  | 
Delete elements (characters) from a string or dynamic array.  | 
|
  | 
Insert one string or dynamic array in another.  | 
Program Example48; { Program to demonstrate the Pos function. } Var S : String; begin S:='The first space in this sentence is at position : '; Writeln (S,pos(' ',S)); S:='The last letter of the alphabet doesn''t appear in this sentence '; If (Pos ('Z',S)=0) and (Pos('z',S)=0) then Writeln (S); end.