|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !Trim String > String Operations |
MiniRobotLanguage (MRL)
STR.RTrim
Intention
The STR.RTrim command is a powerful tool in SPR for removing specific sequences of characters from the right side of a string.
It works by exactly matching the sequence you provide and removing it from the string.
This is particularly useful when you need to clean up strings or remove unwanted patterns without affecting other parts of the string.
The STR.RTrim command removes all occurrences of a specified sequence of characters from the right side of a string.
It only removes exact matches, so if the sequence appears in a different order or with extra characters, it will not be affected.
Key Features:
Removes exact sequences of characters from the right side of a string.
Works on all occurrences of the sequence on the righ side of the string. Leaves the rest of the string untouched.
For removing Single characters better use the VRT.-Command. This one is only to remove sequences, which can not be done with VRT.
Example:
' Define the input string
$$STR =>/World>//>/>
' Remove the sequence "/>"
STR.RTrim|$$STR|/>
' Display the result
MBX. Result: $$RES
' Result is: >/World>/
Syntax
STR.RTrim|P1|P2
Parameter Explanation
P1 - Source and Target-variable.
P2 - The exact sequence of the characters will be removed from the right side of P1
Example
''*************************************
'
'*************************************
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