<RetVar> = The return variable for the command. Holds the result of the command query. (see description below)
<Var/String> = This is the pattern (the characters) that you are looking for.
<Var/String> = This is the string being checked for the above pattern.
Returns -1 if not found.
Returns 0 if the pattern is found at the first character and increments by 1 for each subsequent character position.
If the pattern exists in the string being checked more than once, this command returns the position of the 'first' instance of the pattern it finds.
Examples:
$pattern = 'pat'
$this.string = 'There is a pattern in here somewhere'
$txt.position = find position of pattern $pattern in $this.string
In the above example, $txt.position would equal 11.
_______________________
$pattern = '4'
$this.string = '0123456789'
$txt.position = find position of pattern $pattern in $this.string
In the above example, $txt.position would equal 4.
Command Location:
- »» General Commands
- »» Strings
<RetVar> = find position of pattern <Var/String> in <Var/String>
- »» Strings