String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands >

String Operations

STR. - String Command Family

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.

Comprehensive String Manipulation Suite

 

Overview

The STR. 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.

All 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

 

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

 

Alphabetical Command Reference

 

STR.CIContains / COI – Case-insensitive multi-string containment check

STR.CiInstr / CIINSTR – Case-insensitive substring search

STR.Contains / CON – Check if any of multiple substrings exist

STR.Count / CNT – Count occurrences of a substring

STR.CountAny / CNTA – Count occurrences of any character in a set

STR.Delete / DEL – Remove characters from a string

STR.DeleteTo / DELTO – Delete from position to end or specified point

STR.Extract / EXT – Extract substring after a match

STR.ExtractAny / EXA – Extract after any character in a set

STR.Find / FIN – Basic forward/reverse search (uses INSTR)

STR.FindAny / FAY – Search for any character in a set

STR.FindBestMatch / FBM – Fuzzy match against a list

STR.FromBase64URL / FBU – Decode Base64URL

STR.FromHexAsci / FAS – Decode hex-ASCII

STR.Generate / GEN – Generate random string from charset

STR.Instr / INSTR – Standard substring search

STR.Insert / INS – Insert string at position

STR.Left / LFT – Extract left N characters

STR.MakePad / MAP – Create padding string

STR.MidTo / MDT – Extract from start to end position

STR.Mid / MIDSTR – Extract middle substring

STR.NInstr / NIS – Nth forward search

STR.Overwrite / OVE – Replace characters in-place

STR.Patch / PAT – Combine delete and insert in one operation

STR.RegExpr / REX – Regular expression search

STR.RegReplace / RGR – Regular expression replace

STR.Remove / REMO – Remove all occurrences of substring

STR.RemoveAny / REMA – Remove all occurrences of any character in set

STR.Remain / REIN – Get string after first match

STR.RemainAny / REIA – Get string after any character in set

STR.Repeat / RPT – Alias for CLONE

STR.Replace / RPL – Replace all occurrences

STR.ReplaceAny / RPA – Replace characters from set

STR.Reverse / REV – Reverse string order

STR.Right / RGT – Extract right N characters

STR.RNInstr / RNIS – Nth reverse search with overlap/case options

STR.SetLeft / SEL – Replace left portion (length-changing)

STR.SetLeftB / SELB – Replace left in-place (fixed length)

STR.SetRight / SER – Replace right portion (length-changing)

STR.SetRightB / SERB – Replace right in-place (fixed length)

STR.SetMidCount / SMI – Replace middle portion (length-changing)

STR.SetMidCountB / SMIB – Replace middle in-place (fixed length)

STR.SetMidTo / SMT – Replace from start to end (length-changing)

STR.SetMidToB / SMB – Replace from start to end in-place (fixed length)

STR.Shrink / SHK – Collapse repeated delimiters

STR.SplitString / SPS – Split on first delimiter

STR.String / STR – Repeat single character (uses STRING$)

STR.StrBetween / SBT – Extract between delimiters

STR.ToBase64URL / TBU – Encode to Base64URL

STR.ToHexAsci / TAS – Encode to hex-ASCII

STR.LTrim / LTRIM – Trim multi-character delimiters from left

STR.RTrim / RTRIM – Trim multi-character delimiters from right

STR.Trim / TRIM – Trim multi-character delimiters from both sides

STR.Unwrap / UNW – Remove wrapping characters

STR.Wrap / WRP – Add wrapping characters

STR.XInstr / XIN – Unified Nth search (forward/reverse via sign)

STR.CiRetain / CIRTN – Case-insensitive retain

STR.Retain / RTN – Retain specified characters

STR.RetainAny / RTA – Retain any of specified characters

STR.RevInstr / REVI – Simple reverse search

STR.Chars A / CHA – Generate random