Skip to main content

Utilities

Sub-string extraction

The {SUBSTR} code is used to extract a sub-string from a text. The first parameter is the text to process, the next is a (zero based) index of the first character to extract, and the optional third parameter is the number of characters to extract. If the number of characters is not specified, all characters until the end of the text will be extracted.

For the following examples, assume that the variable MyVariable contains the value ABCDEFGH:, and that the current year is 2024:

{SUBSTR;{VARIABLE;MyVariable};3}    ->  DEFGH
{SUBSTR;{VARIABLE;MyVariable};3,1} -> D
{SUBSTR;{VARIABLE;MyVariable};0,2} -> AB
{SUBSTR;{YEAR};3;1} -> 4