Open utterances-bot opened 2 years ago
It may be worth mentioning that any apostrophes have to be escaped such as:
trace('Gary\'s GPA is $gpa');
This isn't really related to string interpolation, but we could cross-reference https://haxe.org/manual/std-String-literals.html
Haxe is the rare bird that converts to single quotations, from double quotations, in order to effectuate string interpolation which potentially can give rise to the use of escaping apostrophes.
I discovered you can use interpolation with custom classes objects by implementing the "toString()" function. When you do something like 'x is $x'
, this actually seems to call 'x is ${x.toString()}'
String Interpolation - Haxe - The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
https://haxe.org/manual/lf-string-interpolation.html