Usage
Syntax: str.positions(substring)
Returns an array of indexes.
Explanation
Returns an array of all the indexes where the substring starts. Is good to use when the substring appears more then once in the string.
Example
function onCreated() { temp.string = "foofoobarfoo"; echo(temp.string.positions("foo")); }
... Will output {0, 3, 9} in RC when on the serverside, or in your F2 menu when on the clientside. If the output is nothing, then the substring was not found at all in the variable.
Categories
CategoryObjectFunction
CategoryFunctionClientside
CategoryFunctionServerside
There are no comments on this page. [Add comment]