Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

JOIN

Combines elements of an array into a single string with a specified separator.

Syntax

result = JOIN(array, separator)

Parameters

ParameterTypeDescription
arrayArrayThe array of elements to join
separatorStringThe delimiter to place between elements

Description

JOIN concatenates all elements of an array into a single string, inserting the specified separator between each element. This is commonly used for creating comma-separated lists, building display strings, or formatting data for output.

Examples

Basic Usage

names = ["Alice", "Bob", "Charlie"]
result = JOIN(names, ", ")
TALK result
' Output: "Alice, Bob, Charlie"

Creating Hashtag Lists

tags = ["GeneralBots", "AI", "Automation", "NoCode"]
hashtags = JOIN(tags, " #")
hashtags = "#" + hashtags
TALK hashtags
' Output: "#GeneralBots #AI #Automation #NoCode"

Building File Paths

parts = ["documents", "reports", "2025", "sales.pdf"]
path = JOIN(parts, "/")
TALK "File: " + path
' Output: "File: documents/reports/2025/sales.pdf"

Email Recipients

recipients = ["john@example.com", "jane@example.com", "bob@example.com"]
to_list = JOIN(recipients, "; ")
SEND MAIL to_list, "Team Update", "Please review the attached report."

Display Lists

items = FIND "products", "category=electronics"
product_names = []

FOR EACH item IN items
    product_names = APPEND(product_names, item.name)
NEXT

TALK "Available products: " + JOIN(product_names, ", ")

Return Value

Returns a string containing all array elements concatenated with the separator.

  • If the array is empty, returns an empty string
  • If the array has one element, returns that element as a string
  • Null values in the array are converted to empty strings

Sample Conversation

Common Separators

SeparatorUse Case
", "Readable comma-separated lists
","CSV data
"\n"Multi-line output
" "Space-separated words
" | "Table columns
"/"File paths
"; "Email recipients

See Also

  • SPLIT - Split a string into an array (opposite of JOIN)
  • FOR EACH - Iterate over arrays
  • FILTER - Filter arrays before joining