%concat(<&ref:[idx]>, <delim>)
Used to join two or more attributes, separated by an optional delimiter.
This expansion is the inverse of 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
&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 "+"
string foo
&foo += { "a", "c", "c", "d" } # abcd
&foo += &control.Tmp-String-0[*]