Project

General

Profile

$pos » History » Revision 3

Revision 2 (Per Amundsen, 08/11/2015 04:28 AM) → Revision 3/4 (Per Amundsen, 08/11/2015 04:29 AM)

_Added in 1.8.10_ 

 *$pos(string,substring,N)* 

 Returns a number indicating the position of the Nth occurrence of string in text. 

 _[[$pos]] is case-insensitive, case-issensitive, see [[$poscs]] for case-sensitive version._ 

 *Parameters* 

 string - String to search. 
 substring- Substringto search. 
 N - If N = 0, total number of matches, otherwise the Nth match. 

 *Example* 

 <pre> 
 ; Print number of matches for the substring 'e'. 
 //echo -ag $pos(hello there,e,1) 

 ; Print the position of the second match using substring 'e'. 
 //echo -ag $pos(hello there,e,2) 
 </pre>