join
Join combines an array of strings into a single string with a separator.
Join combines an array of strings into a single string with a separator. Defaults to newline if no separator is provided.
Input
array
Parameters
| # | Type | Required |
|---|---|---|
| 0 | string | no |
Returns
string
Examples
Join tags into a CSV string
Input
tags = ["coffee", "sale", "new"]Template
{{ tags | join:',' }}Output
coffee,sale,newRebuild lines into a paragraph
Input
lines = ["Dear Alice,", "Welcome aboard.", "Best,"]Template
{{ lines | join }}Output
Dear Alice,
Welcome aboard.
Best,Join with a custom separator
Input
steps = ["sign in", "verify email", "start tour"]Template
{{ steps | join:' | ' }}Output
sign in | verify email | start tourHow is this guide?