Awee

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

#TypeRequired
0stringno

Returns

string

Examples

Join tags into a CSV string

Input

tags = ["coffee", "sale", "new"]

Template

{{ tags | join:',' }}

Output

coffee,sale,new

Rebuild 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 tour

How is this guide?

On this page