join
array | join
returns string
Combines all of the items in an array into a single string, separated by a space.
{{ collection.all_tags | join }}
Code
{{ collection.all_tags | join }}Data
{
"collection": {
"all_tags": [
"extra-potent",
"fresh",
"healing",
"ingredients"
]
}
}Output
extra-potent fresh healing ingredients
Output
extra-potent fresh healing ingredientsAnchor to Custom separator
Custom separator
array | join: string
You can specify a custom separator for the joined items.
{{ collection.all_tags | join: ', ' }}
Code
{{ collection.all_tags | join: ', ' }}Data
{
"collection": {
"all_tags": [
"extra-potent",
"fresh",
"healing",
"ingredients"
]
}
}Output
extra-potent, fresh, healing, ingredients
Output
extra-potent, fresh, healing, ingredientsWas this page helpful?