$poscs » History » Version 1
Per Amundsen, 08/11/2015 04:29 AM
1 | 1 | Per Amundsen | _Added in 1.8.10_ |
---|---|---|---|
2 | |||
3 | *$poscs(string,substring,N)* |
||
4 | |||
5 | Returns a number indicating the position of the Nth occurrence of string in text. |
||
6 | |||
7 | _[[$poscs]] is case-sensitive, see [[$pos]] for case-insensitive version._ |
||
8 | |||
9 | *Parameters* |
||
10 | |||
11 | string - String to search. |
||
12 | substring- Substringto search. |
||
13 | N - If N = 0, total number of matches, otherwise the Nth match. |
||
14 | |||
15 | *Example* |
||
16 | |||
17 | <pre> |
||
18 | ; Print number of matches for the substring 'E'. |
||
19 | //echo -ag $pos(heEllo theEreE,e,1) |
||
20 | |||
21 | ; Print the position of the second match using substring 'E'. |
||
22 | //echo -ag $pos(hEello thEereE,E,2) |
||
23 | </pre> |