Array to string

There must be a prettier way than this of turning an array into a string. The following code does the job but is not very clean.
In my real patch, ~barkAmp is an array of changing frequencies.

~barkAmp = Array.fill(24,{ arg i; i*1});

z = “<%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%>”.format(~barkAmp[0], ~barkAmp[1],~barkAmp[3],~barkAmp[4],~barkAmp[5],~barkAmp[6],~barkAmp[7],~barkAmp[8],~barkAmp[9],~barkAmp[10],~barkAmp[11],~barkAmp[12],~barkAmp[13],~barkAmp[14],~barkAmp[15],~barkAmp[16],~barkAmp[17],~barkAmp[18],~barkAmp[19],~barkAmp[20],~barkAmp[21],~barkAmp[22],~barkAmp[23]);

I tried with collect but couldn’t make it work. If if use format in the way of .format(~barkAmp[0…24]);

  • I receive the following: <[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ],>

Also, why is there a comma between the last integer (23) and the final >?
<0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,>

Thanks, Adam

Hej Adam, would

 "<" ++ ~barkAmp.join(",") ++ ">"

work in this case?

Hej Johannes,

yes, that works, thanks so much!