Algosim documentation: ~

~ (tilde)

The concatenation operator.

Syntax

Description

Notes

The n-ary concatenation operator ~ is implemented by the concat function.

For strings, the end result of a ~ b ~ ⋯ is the same as that of a + b +, but the concatenation operator is more performant, partly because it is n-ary while + is binary.

To join all strings in a list, use the join function.

To create a string with variable parts from a template, use the format function.

Examples

"alpha" ~ "beta" ~ "gamma"
alphabetagamma
❨5, 1, 2❩ ~ ❨−5, i, 2❩ ~ ❨1, 2, 3, 4❩ ~ ❨0❩
(5, 1, 2, −5, i, 2, 1, 2, 3, 4, 0)
'("alpha", 394, 713, π) ~ '(true, false, 5) ~ '(i, −i, color("red"))
alpha
394
713
3.14159265359
true
false
5
i
−i
rgba(1.000, 0.000, 0.000, 1.000)

See also