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

String

String.base64Decode()

Description: Converts plain text to a base64-encoded string

Syntax: String.base64Encode()

Returns: String

Source: Custom n8n functionality

Examples:

"aGVsbG8=".base64Decode() //=> "hello"

String.base64Encode()

Description: Converts a base64-encoded string to plain text

Syntax: String.base64Encode()

Returns: String

Source: Custom n8n functionality

Examples:

"hello".base64Encode() //=> "aGVsbG8="

String.concat()

Description: Joins one or more strings onto the end of the base string. Alternatively, use the + operator (see examples).

Syntax: String.concat(string1, string2?, ..., stringN?)

Returns: String

Source: JavaScript function

Parameters:

  • string1 (String) - The first string to append

  • string2 (String) - optional - The second string to append

  • stringN (String) - optional - The Nth string to append

Examples:

String.extractDomain()

Description: If the string is an email address or URL, returns its domain (or undefined if nothing found).

If the string also contains other content, try using extractEmail() or extractUrl() first.

Syntax: String.extractDomain()

Returns: String

Source: Custom n8n functionality

Examples:

String.extractEmail()

Description: Extracts the first email found in the string. Returns undefined if none is found.

Syntax: String.extractEmail()

Returns: String

Source: Custom n8n functionality

Examples:

String.extractUrl()

Description: Extracts the first URL found in the string. Returns undefined if none is found. Only recognizes full URLs, e.g. those starting with http.

Syntax: String.extractUrl()

Returns: String

Source: Custom n8n functionality

Examples:

String.extractUrlPath()

Description: Returns the part of a URL after the domain, or undefined if no URL found.

If the string also contains other content, try using extractUrl() first.

Syntax: String.extractUrlPath()

Returns: String

Source: Custom n8n functionality

Examples:

String.hash()

Description: Returns the string hashed with the given algorithm. Defaults to md5 if not specified.

Syntax: String.hash(algo?)

Returns: String

Source: Custom n8n functionality

Parameters:

  • algo (String) - optional - The hashing algorithm to use. One of md5, base64, sha1, sha224, sha256, sha384, sha512, sha3, ripemd160

Examples:

String.includes()

Description: Returns true if the string contains the searchString. Case-sensitive.

Syntax: String.includes(searchString, start?)

Returns: Boolean

Source: JavaScript function

Parameters:

  • searchString (String) - The text to search for

  • start (Number) - optional - The position (index) to start searching from

Examples:

String.indexOf()

Description: Returns the index (position) of the first occurrence of searchString within the base string, or -1 if not found. Case-sensitive.

Syntax: String.indexOf(searchString, start?)

Returns: Number

Source: JavaScript function

Parameters:

  • searchString (String) - The text to search for

  • start (Number) - optional - The position (index) to start searching from

Examples:

String.isDomain()

Description: Returns true if the string is a domain

Syntax: String.isDomain()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.isEmail()

Description: Returns true if the string is an email

Syntax: String.isEmail()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.isEmpty()

Description: Returns true if the string has no characters or is null

Syntax: String.isEmpty()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.isNotEmpty()

Description: Returns true if the string has at least one character

Syntax: String.isNotEmpty()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.isNumeric()

Description: Returns true if the string represents a number

Syntax: String.isNumeric()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.isUrl()

Description: Returns true if the string is a valid URL

Syntax: String.isUrl()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.length

Description: The number of characters in the string

Syntax: String.length

Returns: Number

Source: JavaScript function

Examples:

String.match()

Description: Matches the string against a <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression. Returns an array containing the first match, or all matches if the g flag is set in the regular expression. Returns null if no matches are found.

For checking whether text is present, consider includes() instead.

Syntax: String.match(regexp)

Returns: Array

Source: JavaScript function

Parameters:

  • regexp (RegExp) - A <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression with the pattern to look for. Will look for multiple matches if the g flag is present (see examples).

Examples:

String.parseJson()

Description: Returns the JavaScript Object or value represented by the string, or undefined if the string isn’t valid JSON. Single-quoted JSON is not supported.

Syntax: String.parseJson()

Returns: any

Source: Custom n8n functionality

Examples:

String.quote()

Description: Wraps a string in quotation marks, and escapes any quotation marks already in the string. Useful when constructing JSON, SQL, etc.

Syntax: String.quote(mark?)

Returns: String

Source: Custom n8n functionality

Parameters:

  • mark (String) - optional - The type of quotation mark to use

Examples:

String.removeMarkdown()

Description: Removes any Markdown formatting from the string. Also removes HTML tags.

Syntax: String.removeMarkdown()

Returns: String

Source: Custom n8n functionality

Examples:

String.removeTags()

Description: Removes tags, such as HTML or XML, from the string

Syntax: String.removeTags()

Returns: String

Source: Custom n8n functionality

Examples:

String.replace()

Description: Returns a string with the first occurrence of pattern replaced by replacement.

To replace all occurrences, use replaceAll() instead.

Syntax: String.replace(pattern, replacement)

Returns: String

Source: JavaScript function

Parameters:

  • pattern (String|RegExp) - The pattern in the string to replace. Can be a string to match or a <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression.

  • replacement (String) - The new text to replace with

Examples:

String.replaceAll()

Description: Returns a string with all occurrences of pattern replaced by replacement

Syntax: String.replaceAll(pattern, replacement)

Returns: String

Source: JavaScript function

Parameters:

  • pattern (String|RegExp) - The pattern in the string to replace. Can be a string to match or a <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression.

  • replacement (String|function) - The new text to replace with. Can be a string or a function that returns a string (see examples).

Examples:

String.replaceSpecialChars()

Description: Replaces special characters in the string with the closest ASCII character

Syntax: String.replaceSpecialChars()

Returns: String

Source: Custom n8n functionality

Examples:

String.search()

Description: Returns the index (position) of the first occurrence of a pattern within the string, or -1 if not found. The pattern is specified using a <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression. To use text instead, see indexOf().

Syntax: String.search(regexp)

Returns: Number

Source: JavaScript function

Parameters:

  • regexp (RegExp) - A <a href=”https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions”>regular expression with the pattern to look for

Examples:

String.slice()

Description: Extracts a fragment of the string at the given position. For more advanced extraction, see match().

Syntax: String.slice(start, end?)

Returns: String

Source: JavaScript function

Parameters:

  • start (Number) - The position to start from. Positions start at 0. Negative numbers count back from the end of the string.

  • end (String) - optional - The position to select up to. The character at the end position is not included. Negative numbers select from the end of the string. If omitted, will extract to the end of the string.

Examples:

String.split()

Description: Splits the string into an array of substrings. Each split is made at the separator, and the separator isn’t included in the output.

The opposite of using join() on an array.

Syntax: String.split(separator?, limit?)

Returns: Array

Source: JavaScript function

Parameters:

  • separator (String) - optional - The string (or regular expression) to use for splitting. If omitted, an array with the original string is returned.

  • limit (Number) - optional - The max number of array elements to return. Returns all elements if omitted.

Examples:

String.startsWith()

Description: Returns true if the string starts with searchString. Case-sensitive.

Syntax: String.startsWith(searchString, start?)

Returns: Boolean

Source: JavaScript function

Parameters:

  • searchString (String) - The text to check against the start of the base string

  • start (Number) - optional - The position (index) to start searching from

Examples:

String.substring()

Description: Extracts a fragment of the string at the given position. For more advanced extraction, see match().

Syntax: String.substring(start, end?)

Returns: String

Source: JavaScript function

Parameters:

  • start (Number) - The position to start from. Positions start at 0.

  • end (String) - optional - The position to select up to. The character at the end position is not included. If omitted, will extract to the end of the string.

Examples:

String.toBoolean()

Description: Converts the string to a boolean value. 0, false and no resolve to false, everything else to true. Case-insensitive.

Syntax: String.toBoolean()

Returns: Boolean

Source: Custom n8n functionality

Examples:

String.toDateTime()

Description: Converts the string to a DateTime. Useful for further transformation. Supported formats for the string are ISO 8601, HTTP, RFC2822, SQL and Unix timestamp in milliseconds.

To parse other formats, use <a href=”https://moment.github.io/luxon/api-docs/index.html#datetimefromformat”> DateTime.fromFormat().

Syntax: String.toDateTime()

Returns: DateTime

Source: Custom n8n functionality

Examples:

String.toJsonString()

Description: Prepares the string to be inserted into a JSON object. Escapes any quotes and special characters (e.g. new lines), and wraps the string in quotes.

The same as JavaScript’s JSON.stringify().

Syntax: String.toJsonString()

Returns: String

Source: Custom n8n functionality

Examples:

String.toLowerCase()

Description: Converts all letters in the string to lower case

Syntax: String.toLowerCase()

Returns: String

Source: JavaScript function

Examples:

String.toNumber()

Description: Converts a string representing a number to a number. Throws an error if the string doesn’t start with a valid number.

Syntax: String.toNumber()

Returns: Number

Source: Custom n8n functionality

Examples:

String.toSentenceCase()

Description: Changes the capitalization of the string to sentence case. The first letter of each sentence is capitalized and all others are lowercased.

Syntax: String.toSentenceCase()

Returns: String

Source: Custom n8n functionality

Examples:

String.toSnakeCase()

Description: Changes the format of the string to snake case. Spaces and dashes are replaced by _, symbols are removed and all letters are lowercased.

Syntax: String.toSnakeCase()

Returns: String

Source: Custom n8n functionality

Examples:

String.toTitleCase()

Description: Changes the capitalization of the string to title case. The first letter of each word is capitalized and the others left unchanged. Short prepositions and conjunctions aren’t capitalized (e.g. ‘a’, ‘the’).

Syntax: String.toTitleCase()

Returns: String

Source: Custom n8n functionality

Examples:

String.toUpperCase()

Description: Converts all letters in the string to upper case (capitals)

Syntax: String.toUpperCase()

Source: JavaScript function

Examples:

String.trim()

Description: Removes whitespace from both ends of the string. Whitespace includes new lines, tabs, spaces, etc.

Syntax: String.trim()

Returns: String

Source: JavaScript function

Examples:

String.urlDecode()

Description: Decodes a URL-encoded string. Replaces any character codes in the form of %XX with their corresponding characters.

Syntax: String.urlDecode(allChars?)

Returns: String

Source: Custom n8n functionality

Parameters:

  • allChars (Boolean) - optional - Whether to decode characters that are part of the URI syntax (e.g. =, ?)

Examples:

String.urlEncode()

Description: Encodes the string so that it can be used in a URL. Spaces and special characters are replaced with codes of the form %XX.

Syntax: String.urlEncode(allChars?)

Returns: String

Source: Custom n8n functionality

Parameters:

  • allChars (Boolean) - optional - Whether to encode characters that are part of the URI syntax (e.g. =, ?)

Examples:

Last updated

Was this helpful?