String interpolation: Difference between revisions

Content deleted Content added
m Haxe: fmt.
Line 132:
var bananas = 3;
trace('I have $apples apples.');
trace('I have ${apples+bananas} fruitfruits.');
</syntaxhighlight>
IThe haveoutput 7will fruit.</syntaxhighlight>be:<ref>{{Cite news|url=https://haxe.org/manual/lf-string-interpolation.html|title=Haxe - Manual - String interpolation|work=Haxe - The Cross-platform Toolkit|access-date=2017-09-12}}</ref>
<syntaxhighlight lang="output">I have 4 apples.
I have 4 apples.
I have 7 fruits.
</syntaxhighlight>
The output will be:
<syntaxhighlight lang="output">I have 4 apples.
I have 7 fruit.</syntaxhighlight><ref>{{Cite news|url=https://haxe.org/manual/lf-string-interpolation.html|title=Haxe - Manual - String interpolation|work=Haxe - The Cross-platform Toolkit|access-date=2017-09-12}}</ref>
 
=== Java ===