String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !STR.- String Command >

String Operations

STR.XInstr

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.XInstr

If Result available

 

clip0857

 

Intention

 

This command searches for the Nth occurrence (P3) of a specified string (P2) within a source string (P1).

The result is placed on the Top of Stack (TOS) or in an optional variable (P4). The search is case-sensitive.

 

 

 

Syntax

 

 

STR.XInstr|P1|P2|P3[|P4]

 

 

 

Parameter Explanation

 

P1 - (Source String) The main string in which to search for the specified string.

P2 - (Search String) The string to search for.

P3 - (Occurrence Number) The Nth occurrence of the string to find.

P4 - (Optional) Variable for storing the result. If omitted, the result is placed on TOS.

 

 

 

 

Example

 

'***********************************

' IRS.-Sample

'***********************************

$$SRC=<helloWorldHelloWorld>

$$SCH=Hello

$$OCC=2

STR.XINSTR|$$SRC|$$SCH|$$OCC

POP.$$RES

POP.$$NUM

MBX.$$RES # $$NUM

ENR.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: