This operation joins array elements with a string followed by operation character.
Let's say the have the following JavaScript array:
fruits = ['Mango', 'Banana', 'Annona', 'Grape'];
To join array elements with comma we can use the following expression:
${fruits&,}
The
& is an operation special character and the
comma is delimiter.
Now let's join array elements with
*** ( 3 stars ).
The star character is reserved for
Mandatory value operation, therefore we
need to escape each star:
${fruits&\*\*\*}
Additionally you can use a
\n and
\t characters for array items
delimiter.
For example you can join array elements with LF character:
${fruits&\n}
You can also join array elements with a delimiter provided as expression:
${fruits&${myDelimiter}}