1``join``
2========
3
4.. versionadded:: 2.6.1
5
6    The ``and`` argument was added in Twig 2.6.1.
7
8The ``join`` filter returns a string which is the concatenation of the items
9of a sequence:
10
11.. code-block:: twig
12
13    {{ [1, 2, 3]|join }}
14    {# returns 123 #}
15
16The separator between elements is an empty string per default, but you can
17define it with the optional first parameter:
18
19.. code-block:: twig
20
21    {{ [1, 2, 3]|join('|') }}
22    {# outputs 1|2|3 #}
23
24A second parameter can also be provided that will be the separator used between
25the last two items of the sequence:
26
27.. code-block:: twig
28
29    {{ [1, 2, 3]|join(', ', ' and ') }}
30    {# outputs 1, 2 and 3 #}
31
32Arguments
33---------
34
35* ``glue``: The separator
36* ``and``: The separator for the last pair of input items
37