String interpolation (included): Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
(added langur language example)
Line 1,448: Line 1,448:
-> Mary had a little lamb
-> Mary had a little lamb
</syntaxhighlight>
</syntaxhighlight>

=={{header|langur}}==
All interpolations in langur use double curly braces.

<syntaxhighlight lang="langur">val .x = "little"
writeln "Mary had a {{.x}} lamb."</syntaxhighlight>

Modifiers follow the interpolated value with a colon.
<syntaxhighlight lang="langur">writeln "Lamb count: {{.x : 7}}"</syntaxhighlight>

Modifiers may be chained within a single interpolation.
<syntaxhighlight lang="langur">writeln "Partial lamb count: {{.x : r2 : 10}}"
# rounds to 2 decimal places, then aligns to 10 code points
# (hopefully no partial lambs)
</syntaxhighlight>

See https://langurlang.org/features/interpolation/ for more details.


=={{header|Lasso}}==
=={{header|Lasso}}==