String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.Retain

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.Retain

Retains Specified Substrings in a String

 

clip0849

 

 

Intention

 

This command is used to retain only the substrings in the source string that match the entire given match string. All other characters are removed.

The command is case-sensitive.

When you use STR.Retain, the function looks for the entire match string as a substring in the source string.

  It will keep only those substrings that match the match string.

 

 

 

 

Syntax

 

 

STR.Retain|P1|P2[|P3]

STR.Rtn|P1|P2[|P3]

 

 

 

Parameter Explanation

 

P1 - (Source String) The main string from which to retain substrings.

P2 - (Match String) The string containing the substring to be retained.

P3 - (Optional) Variable for the result. If omitted, the result is placed in P1.

 

 

 

Example

 

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

' STR.-Sample

'***********************************
$$SRC=<abc123abc123>

$$MAT=<abc>

STR.Retain|$$SRC|$$MAT|$$RES

' $$RES will contain "abcabc"

ENR.

 

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: