<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !Trim String > String Operations |
MiniRobotLanguage (MRL)
VLT. Command
Variable Left sides Trim
Intention
This command can be used to Trim Spaces from the left side of a variable-value.
By using the optional parameters you can trim any chars from the left side of the variable value.
Example:
VAR.§§LIN= 345 Hallo Marco
' We first remove the outer Spaces
VLT.§§LIN
DBP.>§§LIN<
' Result is: >345 Hallo Marco <
Now we use the Parameter P2.
VAR.§§LIN= 345 Hallo Marco
' $sp$ is a system-variable that is resolved to a SPACE character
VLT.§§LIN|$sp$345
DBP.>§§LIN<
' Result is: >Hallo Marco <
Now we use the third mode, for this Parameter P2 is the term "all"
VAR.§§LIN= $crlf$ 345 Hallo Marco
' "all" means all characters with ASCII codes below 33
VLT.§§LIN|all
DBP.>§§LIN<
' Result is: >345 Hallo Marco<
Syntax
VLT.[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 at the left 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 left side of P1.
Speed in Ticks:
This command uses typically around 290 Ticks.
Example
''*************************************
' VLT/VBT/SBD - DEMO
'*************************************
'DBM.2
VAR.§§LIN= 345 Hallo Marco
' We first remove the outer Spaces
VBT.§§LIN
PRT.>§§LIN<
' Now we remove the outer numbers and spaces
VLT.§§LIN|123 4567890
PRT.>§§LIN<
SBD.§§LIN|$sp$|4|§§ERG
MBX.§§ERG
END.
Remarks
-
Limitations:
-
See also:
• 1.5.2 Working with Text-Strings
• VBT. - Variable-Both-sides-Trim
• VTU. - Variable to Uppercase
• VTL. - Variable to Lowercase
• VTM. - Variable to Mediumcase
• VRD. - Variable-Remove-Doubles
• VAR. - Variable Set Value/Clear
• IVS. / NVS. - If-Variable-String
• SBD. - String between Delimiter
• SBM. - String between Delimiter-Multiple