String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !BLO.-Block-Commands > Block Manipulation >

String Operations

BLO.BlockRemoveContent

Previous Top Next


MiniRobotLanguage (MRL)

 

BLO.BlockRemoveContent

Removes content from inside the Nth block.

 

Intention

 

This command finds the Nth top-level block in a string and deletes only the content *between* its start and end delimiters. The delimiters themselves are left in place, resulting in an empty block.

 

Removing Content vs. Block

 

1. Remove Content:

Source:           [DATA]important[/DATA]

Result:           [DATA][/DATA]

 

2. Remove Block:

Source:           Data: [SECRET]abc[/SECRET]

Result:           Data:

 

 

Syntax

 

BLO.BlockRemoveContent|P1|P2|P3|P4[|P5]

 

Parameter Explanation

 

P1 - (Input/Output, Text) The variable containing the source string.

P2 - (Input, Text) The starting delimiter string.

P3 - (Input, Text) The ending delimiter string.

P4 - (Input, Numeric) The 1-based index of the block to modify.

P5 - (Output, Text) Optional. A different variable to store the modified string. If omitted, P1 is modified in place.

 

Example

 

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

' BLO.BlockRemoveContent Example

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

$$SRC=[TAG]Hello[/TAG][TAG]World[/TAG]

' Remove the content of the first block

BLO.BlockRemoveContent|$$SRC|"[TAG]"|"[/TAG]"|1

' $$SRC now contains "[TAG][/TAG][TAG]World[/TAG]"

MBX.$$SRC

ENR.