Jump to content

String interpolation (included): Difference between revisions

added langur language example
m (→‎{{header|Wren}}: Changed to Wren S/H)
(added langur language example)
Line 1,448:
-> Mary had a little lamb
</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}}==
890

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.