View Single Post
Old 05-26-2022, 03:15 PM   #410
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,480
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
strcat: What would be the best way to add the comma separators here? I thought of "if id then output" but that seems clumsy.
You can do it with list_join. I don't have your actual text and don't want to read/type it in, but it would look something like

Code:
program:
list_join(
    ',',
    if x then urls_from_identifiers('foo:bar', 0) fi, ',',
    if y then urls_from_identifiers('mumble:fratz', 0) fi, ',')
The list_join function ignores empty lists.
chaley is offline   Reply With Quote