Project

General

Profile

Actions

Added in 1.8.10

$poscs(string,substring,N)

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

$poscs is case-sensitive, see $pos for case-insensitive version.

Parameters

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

Example

; Print number of matches for the substring 'E'.
//echo -ag $pos(heEllo theEreE,e,1)

; Print the position of the second match using substring 'E'.
//echo -ag $pos(hEello thEereE,E,2)

Updated by Per Amundsen over 1 year ago · 2 revisions

Also available in: PDF HTML TXT