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