String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !Trim String >

String Operations

STR.Trim - remove multi character sequences

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.Trim

   Remove multi character sequences from both sides

 

 

Intention

 

The STR.Trim command is a powerful tool in SPR for removing specific sequences of characters from 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.Trim command removes all occurrences of a specified sequence of characters from 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.

 

Works on all occurrences of the sequence on both sides, but no inside of the string. Leaves the rest of the string untouched.

For removing Single characters better use the VBT.-Command. This one is only to remove sequences, which can not be done with VBT.

 

 

Example:

 

' Define the input string

$$STR =/>>/World/>/>/>

 

' Remove the sequence "/>"

STR.Trim|$$STR|/>

 

' Display the result

MBX. Result: $$RES

' Result is: >/World

 

 

Syntax

 

STR.Trim|P1|P2

 

 

Parameter Explanation

 

P1   - Source and Target-variable.

 

P2   - The exact sequence of the characters will be removed at both sides of P1

 

 

 

 

Example

 

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

'

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

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.5.2 Working with Text-Strings

    VLT - Variable-Left-Trim

    VRT. - Variable-Right-Trim

    VTU. - Variable to Uppercase

    VTL. - Variable to Lowercase

    VTM. - Variable to Mediumcase

    VRD. - Variable-Remove-Doubles

    GFS. - Get-Filtered-String

    VAR. - Variable Set Value/Clear

    IVS. / NVS. - If-Variable-String

    ! STR. - String Command

    GSS. - GetSplitString

    GES. - Get-Extracted-String

    SBD. - String between Delimiter

    SBM. - String between Delimiter-Multiple

    FEM. - For Each Member

    LEN. - Length-of-String

    RPL. - RePLace in String