Substr.PosEx Method

function PosEx(const SubStr: string; const S: Substring; const Offset: Integer = 1): Integer; overload; inline;

The 1-based position of SubStr in S at or after Offset, 0 if none.

#NameTypeDescription
1SubStrstring
2SSubstring
3OffsetInteger

Returns: Integer

Remarks:

SubStr takes every text kind.

Examples

Searching from an offset.

uses Substr;

procedure Example;
begin
    Assert(PosEx('b', Substring('abcb')) = 2);
    Assert(PosEx('b', Substring('abcb'), 3) = 4);
end;