String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.ReplaceAny / STR.Rpa

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.ReplaceAny

Replace Any Matching Characters in a String with the corresponding character in a second string

 

clip0840

 

Intention

 

This command is used to replace each occurrence of each character in P2 string with the corresponding character in P3 within the main string P1.

 

 

 

Syntax

 

 

STR.ReplaceAny|P1|P2|P3

STR.Rpa|P1|P2|P3

 

 

Parameter Explanation

 

P1 - (Mainstring, Text) Variable containing the source and the destination string.

P2 - (MatchString, Text) String containing characters to be replaced.

P3 - (NewString, Text) String containing characters to replace with.

 

 

 

Example

 

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

' STR.-Sample

'***********************************
' Replace all occurrences of 'a' with '1' and 'b' with '2' in the string

$$SRC=ababab

$$MAT=ab

$$NEW=12

STR.ReplaceAny|$$SRC|$$MAT|$$NEW  

' $$SRC will now contain '121212'

ENR.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: