<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !STR.- String Command > String Operations |
MiniRobotLanguage (MRL)
STR.SetMidCount
Replace a Substring with a Specified Count of Characters
Intention
This command is used to replace a substring within a main string, starting from a specified position and for a specified count of characters.
The final string will be written back to the variable in P1. This command can change the length of the string in P1.
Syntax
STR.SetMidCount|P1|P2|P3[|P4]
STR.Smi|P1|P2|P3[|P4]
Parameter Explanation
•P1 - Main string variable where the replacement will occur.
•P2 - Start position in the main string.
•P3 - Count of characters to replace from the start position.
•P4 - Replacement string.
Example
'***********************************
' STR.-Sample
'***********************************
$$SRC=<Hello World>
$$STA=7
$$CNT=5
$$REP=Universe
STR.SetMidCount|$$SRC|$$STA|$$CNT|$$REP
' $$SRC will now contain "<Hello Universe>"
ENR.
Remarks
-
Limitations:
-
See also:
•