= %concat(<&ref:[idx]>, <delim>)

Used to join two or more attributes, separated by an optional delimiter.

This expansion is the inverse of xref:xlat/explode.adoc[explode].

.Return: _string_

In most cases, `%concat(...)` is only useful inside of a dynamically
expanded string.  If you need to concatenate strings together in a policy, just use `+`.

.Example

[source,unlang]
----
&control += {
	&Tmp-String-0 = "aaa"
	&Tmp-String-0 = "bb"
	&Tmp-String-0 = "c"
}

&reply += {
    &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ', ')"
    &Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ',')"
}
----

.Output

```
aaa, bb, c
aaa,bb,c
```

.Using "+"
[source,unlang]
----
string foo

&foo += { "a", "c", "c", "d" } # abcd

&foo += &control.Tmp-String-0[*]
----

// Copyright (C) 2023 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
// This documentation was developed by Network RADIUS SAS.
