<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !Trim String > String Operations |
MiniRobotLanguage (MRL)
VRT. Command
Variable Right sides Trim
Intention
This command can be used to Trim Spaces from the right side of a variable-value.
By using the optional parameters you can trim any chars from the right side of the variable value.
Example:
VAR.§§LIN= 345 Hallo Marco
' We first remove the outer Spaces
VRT.§§LIN
DBP.>§§LIN<
' Result is: >345 Hallo Marco<
Now we use the Parameter P2.
VAR.§§LIN= Hallo Marco 345
' $sp$ is a system-variable that is resolved to a SPACE character
VRT.§§LIN|$sp$345
DBP.>§§LIN<
' Result is: >Hallo Marco 345<
Now we use the third mode, for this Parameter P2 is the term "all"
VAR.§§LIN=345 Hallo Marco $crlf$
' "all" means all characters with ASCII codes below 33
VRT.§§LIN|all
DBP.>§§LIN<
' Result is: >345 Hallo Marco<
Syntax
VRT.[P1][|P2]
Parameter Explanation
P1 - (optional) Source and Target-variable, if omitted,
TOS is used.
P2 - (optional) if given, ANY of the characters in P2
will be trimmed from the right side of P1
If Parameter 2 is "all" the characters from ASCI(0 to 32) and also $CR as well as $LF
will be trimmed from the right side of P1.
Example
''*************************************
' VRT/VBT/SBD - DEMO
'*************************************
'DBM.2
VAR.§§LIN= Hallo Marco 345
' We first remove the outer Spaces
VBT.§§LIN
PRT.>§§LIN<
' Now we remove the outer numbers and spaces
VRT.§§LIN|123 4567890
PRT.>§§LIN<
SBD.§§LIN|$sp$|2|§§ERG
MBX.§§ERG
END.
Remarks
-
Limitations:
-
See also:
• 1.5.2 Working with Text-Strings
• VBT. - Variable-Both-sides-Trim
• VRD. - Variable-Remove-Doubles
• VTU. - Variable to Uppercase
• VTL. - Variable to Lowercase
• VTM. - Variable to Mediumcase
• VAR. - Variable Set Value/Clear
• IVS. / NVS. - If-Variable-String
• SBD. - String between Delimiter
• SBM. - String between Delimiter-Multiple