|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > String Operations |
MiniRobotLanguage (MRL)
STRING - Commands
Comprehensive String Manipulation Suite
Overview
The STRING command family provides a complete set of tools for advanced string and text processing in MiniRobotLanguage (MRL).
From basic extraction and search to block parsing, encoding, and random generation, these commands enable robust data manipulation without external dependencies.
Most commands are binary-safe, support embedded nulls, and preserve original data integrity. Results are placed on the Top of Stack (TOS) or stored in a specified variable.
Command Categories
1. Block Operations
Block operations are especially useful when working with AI output. They allow you to extract AI-generated content that is enclosed in specific delimiters, and even handle numbering or nesting.
2. Delimited Item Commands:
These commands include all the functions you need to work with delimited items, such as those separated by a delimiter like a semicolon in CSV files. You’ll also find commands to swap, modify, insert, or reorder items, especially those organized in columns. In short, these are the go-to commands for editing CSV files.
3. Format String
In this section, you'll find commands to change the output format of strings. For example, you can use the FMT command to format numbers, or align strings to the left, right, or center for well-structured output.
4. STR. - String Command
The STR commands are a tribute to everyone who used to enjoy programming in BASIC. Here you'll find all the classic string commands from every BASIC dialect, whether Atari, C64, or others, plus many additional commands that didn't exist in original BASIC but you always wished for. These include commands like INSERT, DELETE, MID$, LEFT$, RIGHT$, REPEAT$, as well as extras like PATCH, OVERWRITE, DELETE TO, CLIP, WRAP, and UNWRAP. You'll also find commands for converting string encodings between OEM, UTF, BASE64, and HEX ASCII, in both directions. There are commands to generate cryptographic pads, INSTRING commands that work in any direction with case sensitivity options, and a BEST MATCH command using the Levenshtein algorithm. COUNT commands let you count substrings or characters, while INSTRING commands help locate not just the first, but the nth occurrence of a substring. There are also SPLIT STRING commands, STRING BETWEEN, EXTRACT, REMAIN, and the classic SPLIT STRING that splits upon the first delimiter. REPLACE commands allow you to remove or replace strings, and STRING RETAIN lets you filter strings in different ways.
5. TRIM String Commands
Multiple STRING TRIM commands are included, allowing you to trim from left, right, or both sides—not just single characters but entire tokens or lists of characters.
6. UNICODE CONVERSION commands
to convert between ANSI and UNICODE in both directions.
7. Smart Package Robot string commands
such as After Character, After Backslash, Get ASCII Code, CHR$, Concatenate Strings for quick string merging, Before Backslash, Before Character, Clip String Part, Get Filtered String, Filter Out Given Characters—with both positive and negative character filters. Additionally, we provide Regular Expression commands, Get String Count, Get Split String, Length of String, Replace in String, Sort Items, and URL splitting functions.
#StringManipulation #SmartPackageRobot #AutomationTools #RegularExpressions #URLParsing
•Basic Extraction & Positioning: LEFT, RIGHT, MID, MIDTO, EXTRACT, REMAIN
•Search & Find: INSTR, CIINSTR, FIND, FINDANY, NINSTR, RNINSTR, XINSTR, FINDNTHL/R/X
•Modification & Replacement: REPLACE, REPLACEANY, OVERWRITE, INSERT, DELETE, PATCH, REMOVE, RETAIN
•Case & Whitespace Control: TRIM, LTRIM, RTRIM, REVERSE, SHRINK
•String Construction: CLONE (CLO), REPEAT (RPT), STRING (STR), GENERATE (GEN), MAKEPAD (MAP)
•Encoding & Conversion: TO/FROM BASE64, TO/FROM HEXASCI, OEM/ANSI/UTF8 conversion
•Block & Delimiter Parsing: STRBETWEEN, BLOCKGET*, BLOCKCOUNT, BLOCKVALIDATE, BLOCKREPAIR
•Random & Utility: CHARS A-D, WRAP/UNWRAP, SPLITSTRING, PARSE, GRABQUOTED