Difference between revisions of "PosEx"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function PosEx(search, s: AnsiString; from: Integer): Integer; </source> ==Availability== SCAR Divi 3.10 > Current ==Descripti...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function PosEx(search, s: AnsiString; from: Integer): Integer;
+
function PosEx(const SubStr, S: AnsiString; const Offset: Integer): Integer;
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Returns the position of the first occurrence of a [[AnsiString|string]] '''search''' in another string '''s''' while starting the search at the position given by '''from'''.
+
Returns the position of the first occurrence of a [[AnsiString|string]] '''SubStr''' in another string '''S''' starting from the position given by '''Offset'''.
  
 
==Example==
 
==Example==
Line 22: Line 22:
 
==See Also==
 
==See Also==
 
*[[Pos]]
 
*[[Pos]]
 +
*[[LastPosEx]]
 
*[[Copy]]
 
*[[Copy]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:String Functions]]
 
[[Category:String Functions]]

Latest revision as of 09:36, 2 July 2011

Definition

function PosEx(const SubStr, S: AnsiString; const Offset: Integer): Integer;

Availability

SCAR Divi 3.10 > Current

Description

Returns the position of the first occurrence of a string SubStr in another string S starting from the position given by Offset.

Example

begin
  WriteLn(PosEx('a', 'lola abc', 5));
end.

Output:

6

See Also