String Operations

<< Click to Display Table of Contents >>

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

String Operations

STR.Right / STR.rig

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.Right

Extract Characters from the Right of a String

 

 

Intention

 

This command extracts a specified number of characters (P2) from the right end of a source string (P1).

The result is either placed on the Top of Stack (TOS) or in an optional variable (P3).

 

 

 

clip0859      

Here we gett the result from a variable $$RES

 

 

 

clip0860

Here the result comes back in P1

 

Syntax

 

 

STR.Right|P1|P2|P3

STR.Rig|P1|P2|P3

 

 

Parameter Explanation

 

P1 - (Source String) The string from which to extract characters.

P2 - (Number of Characters) The number of characters to take from the right end of the source string.

P3 - (Optional) Variable for storing the result. If omitted, the result is placed on TOS.

 

If P2 is greater than the length of P1, the entire string P1 will be returned.

 

Example

 

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

' STR.-Sample

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

$$SRC=HelloWorld

$$NUM=5

STR.Right|$$SRC|$$NUM

MBX.$$SRC

ENR.

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: