Skip to content

String Toolbox

UPPERCASE

Convert a string to uppercase characters.

{{ uppercase  }}

Parameters

None - Data should be "chained" into this function.

Returns

The string converted into all uppercase.

Example Usage
The Quick Brown Fox Jumps Over The Lazy Dog
{{ uppercase  }}

Would yield:

THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG

lowercase

Convert a string to lowercase characters.

{{ lowercase }}

Parameters

None - Data should be "chained" into this function.

Returns

The string converted into all lowercase.

Example Usage
The Quick Brown Fox Jumps Over The Lazy Dog
{{ lowercase  }}

Would yield:

the quick brown fox jumps over the lazy dog

Base64 Encode

Encode a string to Base64.

{{ b64encode }}

Parameters

None - Data should be "chained" into this function.

Returns

The string converted into Base64.

Example Usage
The Quick Brown Fox Jumps Over The Lazy Dog
{{ b64encode  }}

Would yield:

VGhlIFF1aWNrIEJyb3duIEZveCBKdW1wcyBPdmVyIFRoZSBMYXp5IERvZwo=

Base64 Decode

Decode a string from Base64.

{{ b64decode }}

Parameters

None - Data should be "chained" into this function.

Returns

The Base64 string converted into "normal" text.

Example Usage
VGhlIFF1aWNrIEJyb3duIEZveCBKdW1wcyBPdmVyIFRoZSBMYXp5IERvZwo=
{{ b64decode  }}

Would yield:

The Quick Brown Fox Jumps Over The Lazy Dog

URL Encode

URL Encode a string (helpful when working with APIs).

{{ urlencode }}

Parameters

None - Data should be "chained" into this function.

Returns

The string converted into a URL encode.

Example Usage
The Quick Brown Fox Jumps Over The Lazy Dog
{{ urlencode  }}

Would yield:

The%20Quick%20Brown%20Fox%20Jumps%20Over%20The%20Lazy%20Dog%0A

URL Decode

URL decodes a string.

{{ urldecode }}

Parameters

None - Data should be "chained" into this function.

Returns

The string converted into a URL decode.

Example Usage
The%20Quick%20Brown%20Fox%20Jumps%20Over%20The%20Lazy%20Dog%0A
{{ urldecode }}

Would yield:

The Quick Brown Fox Jumps Over The Lazy Dog

Split (extract section)

Extracts a section from a text or document.

{{ split  | start: "" | end: "" | removeHeaders: "true" }}

Parameters

  • Start: Match string to begin the split. Included in the result. Case-sensitive.

  • End: The match string to end the split. Excluded from the result. Case-sensitive.

  • Remove Headers: If true, remove repeating lines of text (e.g. headers or footers). If false, do not remove repeating text.

Returns

The resulting split chunk of text.

Example Usage
I have 20 cats and 40 dogs.
{{ split | start: "20" | end: "40" | removeHeaders: false }}

Would yield:

20 cats and

Split (on delimiter)

Split a string on the specified delimiter, and store it in the variable name you choose for later use (eg, take a list of comma-separated names, and run a loop with each value).

{{ splitDelim  | delimiter: "," | outputJson: "" | variable: "" }}

Parameters

  • Delimiter: The delimiting string or regex on which to split the input text.
  • Output Json: If true, outputs the split result as a JSON array. Otherwise, this sets the mAIstro variables for the resulting split.
  • Variable: The base variable name to use for the array.

Returns

If Output Json is set to true, returns an array split based on your delimiter.

Example Usage
I have 20 cats and 40 dogs.
{{ splitDelim  | delimiter: "cats" | outputJson: "true" | variable: "" }}

Would yield:

["I have 20 "," and 40 dogs.\n"]

Regular Expression

Performs regular expression on input data. Regular expression can be a powerful feature to extract or replace certain data.

{{ regex  | match: "" | replace: "" | group: "" }}

Parameters

  • Match: The match regex to use. E.g. /[^0-9A-Za-z\s]/g
  • Replace: The string to substitute for matches.
  • Group: The group to extract. This is useful when multiple strings match the regex defined in the Match parameter, and you are only looking for one specific string.

Returns

The replaced text, or in case of using the group parameter, the group match.

Example Usage 1

If you have a text that you need to replace with something else, you can use the following expression:

my name is howardyoo
{{ regex  | match: "yoo" | replace: "yu" }}

Which yields:

my name is howardyu
Example Usage 2

Regex also supports extraction. For example, if you want to extract the email address in a text message, you can do so:

my name is [email protected]
{{ regex | match: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}" | group: "0" }}

This will extract the email address (group 0). The result is:

Example Usage 3

Regex also supports groups, so in case you want to get the last digits of a phone number, you can do so:

my phone number is 213-292-3322
{{ regex  | match: "([0-9]+)-([0-9]+)-([0-9]+)" | group: "3" }}

which will result in:

3322


Escape a String

Escapes a string for use within a JSON object.

{{ jsonEscape  }}

Parameters

None - Data should be "chained" into this function.

Returns

Escapes a string by inserting backslashes next to special characters, in order to overcome programming limitations.

Example Usage
"I saw my mother today, and I told her "I have 20 cats and 40 dogs"."
{{ jsonEscape  }}

Would yield:

\"I saw my mother today, and I told her \"I have 20 cats and 40 dogs\".\"\n