Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Text Manipulation

Text manipulation parameters can be added before a text variable or text constant. Each one takes child parameters in params; the parent does not use expression. The examples below are complete parameter objects from the workflow JSON format.

All of these parameters require a string as their first child. A null value or a number causes an error; it is not automatically converted to text. Use a Text parameter when you need to combine or format values first.

Left Strip

JSON type: lstrip.

Remove characters from the left side of a string. The first child is the text. An optional second child gives the set of characters to remove; leave it out to remove whitespace, including spaces, tabs, and newlines.

{
  "type": "lstrip",
  "params": [
    {
      "type": "template",
      "expression": "00123"
    },
    {
      "type": "template",
      "expression": "0"
    }
  ]
}

This returns "123". The second child is a set of individual characters, not a prefix to remove once. For example, "0 " removes any sequence of zeros and spaces at the beginning. Stripping stops at the first character outside that set. Characters elsewhere in the string stay unchanged.

Right Strip

JSON type: rstrip.

Remove characters from the right side of a string. The first child is the text. An optional second child gives the character set; leave it out to remove whitespace.

This returns "Sally". As with Left Strip, the second child is a set of characters, not a suffix. It removes matching characters from the end until it reaches a character outside that set.

Strip

JSON type: strip.

Remove characters from both ends of a string. The first child is the text. An optional second child gives the character set; leave it out to remove whitespace. It does not remove spaces or other characters from the middle.

This returns "Sally Smith". For all three Strip options, an empty character-set string removes nothing. At runtime, a null second child uses the whitespace default, though the editor expects text. The first child still needs to be a string.

Splitlines

JSON type: splitlines.

Split a string into an array of strings at line breaks. The first and only child is the text. Middle also strips whitespace from both ends of each line.

This returns ["Sally", "", "Marco", "Pat"]. Both Unix (\n) and Windows (\r\n) line breaks work. Blank lines within the text become empty strings; a final line break does not add another item. An empty input string returns an empty array.

This enables text lists to be used with array parameters or comparisons. For example, a list of email addresses can be compared with one email address. If the array is on the left, use (Array of Strings) includes (ARRAY_STRING_INCLUDES); if the array is on the right, use (String) is contained within (STRING_IS_IN). Array membership checks compare whole values, not parts of a line. See Flow Control for all comparison options.

Uppercase

JSON type: upper.

Convert a string to all uppercase. The first and only child supplies the text.

This returns "SALLY SMITH". Digits, spaces, and punctuation stay unchanged. An empty string stays empty.

Lowercase

JSON type: lower.

Convert a string to all lowercase. The first and only child supplies the text.

This returns "sally@example.com". It changes letter case only; it does not remove whitespace. Use Strip as well if you need to remove whitespace around an email address.

Capitalize

JSON type: capitalize.

Convert the first character to uppercase and the rest of the string to lowercase. The first and only child supplies the text. This capitalizes the whole string, not each word.

This returns "Sally smith". Leading whitespace remains in place, so " sALLY" becomes " sally". Use Strip first if the first letter should be the first character. An empty string stays empty.

Last updated

Was this helpful?