in reply to Re: Format and Join an Array in a Template
in thread Format and Join an Array in a Template

Thanks, this works (with .slice(0,-2)). I was simply thinking the wrong way. The fact that the format must be used twice is a little drawback, but I think it does not get much shorter.

It is a pity that the Template module does not provide a 'map' virtual method, otherwise a 'list.map(...).join(...)' would be possible.

Replies are listed 'Best First'.
Re^3: Format and Join an Array in a Template
by ikegami (Patriarch) on Jun 19, 2009 at 17:26 UTC

    The fact that the format must be used twice is a little drawback,

    You could use a [% BLOCK %] to remove the redundancy.