# JOIN Combines elements of an array into a single string with a specified separator. ## Syntax ```basic result = JOIN(array, separator) ``` ## Parameters | Parameter | Type | Description | |-----------|------|-------------| | `array` | Array | The array of elements to join | | `separator` | String | The 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 ```basic names = ["Alice", "Bob", "Charlie"] result = JOIN(names, ", ") TALK result ' Output: "Alice, Bob, Charlie" ``` ### Creating Hashtag Lists ```basic tags = ["GeneralBots", "AI", "Automation", "NoCode"] hashtags = JOIN(tags, " #") hashtags = "#" + hashtags TALK hashtags ' Output: "#GeneralBots #AI #Automation #NoCode" ``` ### Building File Paths ```basic parts = ["documents", "reports", "2025", "sales.pdf"] path = JOIN(parts, "/") TALK "File: " + path ' Output: "File: documents/reports/2025/sales.pdf" ``` ### Email Recipients ```basic 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 ```basic 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 | Separator | Use Case | |-----------|----------| | `", "` | Readable comma-separated lists | | `","` | CSV data | | `"\n"` | Multi-line output | | `" "` | Space-separated words | | `" \| "` | Table columns | | `"/"` | File paths | | `"; "` | Email recipients | ## See Also - [SPLIT](./keyword-split.md) - Split a string into an array (opposite of JOIN) - [FOR EACH](./keyword-for-each.md) - Iterate over arrays - [FILTER](./keyword-filter.md) - Filter arrays before joining ---