Idiom # 53: Join a list of strings
Code
Use as_string to join the elements with a separator:
Alternatively, fold joins elements of a sequence into a
value of the element type. For type string, such operations are defined in feature
strings. For concatenation with a separator, strings.concat
sep is the operation to use.
Mathematically speaking, such an operation is called a monoid. This is
why the type of the argument of fold is Monoid, while
the operations declared in strings inherit
from Monoid.
Runnable Example
Using as_string.
Using fold.