what is the idiomatic way of building strings? let...
# announcements
t
what is the idiomatic way of building strings? lets says I have an initial string
"{ items: "
and want to write ints from an array into it to get: `"{ items: 1 2 3 4 5 }". My first idea was something like:
Copy code
intList.fold("{ items: ") { string, int -> 
    string += "$int "
} += "}"
but it doesnt seem to work