String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.SetLeft / STR.Sel

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.SetLeft

Set Characters at the Left End of a String

 

 

Intention

 

This command is used to set a specified number of characters at the left end of a given string with a new string.

All characters to the right of P2 will be deleted, and replaced with the P3.

This command will change the length of a string if needed.

 

 

 

Syntax

 

 

STR.SetLeft|P1|P2|P3

STR.Ser|P1|P2|P3

 

 

Parameter Explanation

 

P1 - (Mainstring, Text) Variable with the source and Destination string.

P2 - (Input, Numeric) Number of characters to set at the left end of the string.

P3 - (Input, Text) New string to set at the left end.

 

If the number of characters to set is greater than the length of the source string, the source string will be replaced entirely by the new string.

If the number of characters to set is less than one, the source string remains unchanged.

 

Example

 

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

' IRS.-Sample

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

' Set the first 5 characters of the string to "WORLD"

' $$SRC will now contain 'WORLD there'

$$SRC=Hello there

$$CNT=5

$$NEW=WORLD

STR.SetLeft|$$SRC|$$CNT|$$NEW  

ENR.

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: