I am trying to display a list of comma separated values, and don\'t want to display a comma after the last item (or the only item if there is only one).
My code so far:<
If you are willing to use an external library, it seems like sprig library has a "join" function (see here):
join
Join a list of strings into a single string, with the given separator.
list "hello" "world" | join "_"
The above will produce hello_world
join will try to convert non-strings to a string value:
list 1 2 3 | join "+"
The above will produce 1+2+3