String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.SetRight / STR.Ser

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.SetRight

Set Characters at the Right End of a String

 

 

Intention

 

This command is used to replace a specified number of characters at the right 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.SetRight|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 remove at the right end of the string.

P3 - (Input, Text) New string to set at the right 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 last 5 characters of the string to "WORLD"
' $$SRC will now contain 'Hello WORLD'

$$SRC=Hello there

$$CNT=5

$$NEW=WORLD

STR.SetRight|$$SRC|$$CNT|$$NEW  

ENR.

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: