String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.Contains

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.Contains

Checks for the Presence one of Multiple Strings (P2...) in a Source String P1 (Case Sensitive)

 

 

 

clip0853

Output from the Script-Sample below.

 

 

Intention

 

This command is used to check if one or more specified strings are contained within a source string.

The search is case-sensitive.

It returns the position where the string is found and the number of the element found (P2 is 1, P3 is 2, etc.).

 

 

 

Syntax

 

 

STR.Contains|P1|P2[|P3 ... P6]

 

 

 

Parameter Explanation

 

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

P2, P3, ..., P6 - (Optional) Strings to check for their presence in P1. At least one string (P2) must be specified.

 

Result on TOS:

Position where found (e.g., "7" for "World")

Number of the element found (e.g., "2" for P3)

 

 

 

 

Example

 

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

' IRS.-Sample

'***********************************
$$SRC=<HelloWorld>

$$CH1=Bello

$$CH2=World

STR.Contains|$$SRC|$$CH1|$$CH2

DMP.6

MBX.!

' Results see picture above.

ENR.

 

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: