String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.SetMidCountB / STR.Smi

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.SetMidCountB

Replace a Substring with a Specified Count of Characters using a traditional BASIC Algo which will keep the String length

 

 

clip0844

 

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 NOT change the length of the string in P1.

 

 

 

Syntax

 

 

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

STR.SmiB|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: