String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands >

String Operations

Delimited Strings

Previous Top Next


MiniRobotLanguage (MRL)

 

Delimited Strings

Extract, Split, and Clean Delimited Text

 

Intention

These Commands provide powerful tools for parsing, extracting, and cleaning strings that are divided by delimiters — such as CSV files, log entries, or configuration data.

From simple split-and-extract to complex multi-delimiter field extraction and nested block handling, these Commands handle both single-character and multi-character delimiters with precision.

 

Command Overview

 

•GES. - Get Extracted String – Split string at first occurrence of delimiter and return left or right part

•SBD. - String Between Delimiter – Extract the Nth field from a delimited string (e.g., CSV)

•SBM. - String Between Delimiter-Multiple – Extract a range of fields (N to M) from a delimited string

•STR.Parse – Extract the Nth field using a multi-character delimiter

•STR.ParseAny – Extract the Nth field using any character from a set of single-character delimiters

•STR.Shrink – Collapse repeated delimiters into single instances

•VRD. - Variable Remove Doubles – Remove consecutive duplicate characters (spaces, tabs, or custom chars)

 

Key Features

•Supports **multi-character delimiters** (e.g., `,.`, `::`, `->`)

•Supports **single-character delimiter sets** (e.g., `,;.` means split on comma, semicolon, or period)

•**Flexible output**: Results can be stored in a variable or pushed to TOS

•**Binary-safe**: Preserves null bytes and special characters

•**Custom Command delimiter**: Use `P5` in SBD/SBM to change the Command separator from `|` to another character (e.g., `,`)

 

See also

The Stack (TOS)

STR.Instr – Basic substring search

STR.String – Repeat single character