Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Pos(const SubStr: Substring; const OneOffset: Integer = 1): Integer; overload; | |
| 2 | function Pos(const SubStr: string; const OneOffset: Integer = 1): Integer; overload; | The 1-based position of SubStr's first occurrence at or after OneOffset, 0 if none. |
Overload 1: function Pos(const SubStr: Substring; const OneOffset: Integer = 1): Integer; overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | SubStr | Substring | |
| 2 | OneOffset | Integer |
Returns: Integer
Overload 2: function Pos(const SubStr: string; const OneOffset: Integer = 1): Integer; overload;
The 1-based position of SubStr's first occurrence at or after OneOffset, 0 if none.
| # | Name | Description |
|---|---|---|
| 1 | SubStr | The text searched for, every text kind; an empty one is never found. |
| 2 | OneOffset | The first position searched, 1-based; below 1 the result is 0. |
Returns: Integer - The position in the window, 1-based, or 0.
Examples
Positions in a text.
uses Substr;
procedure Example;
var s: Substring;
begin
s := Substring('hello');
Assert(s.Pos('l') = 3);
Assert(s.Pos('l', 4) = 4);
Assert(s.Pos('z') = 0);
end;