String Concatenation and Interpolation in Twig

String concatenation

echo $twig->render('string.twig', array("numA" => "1", "numB" => "9"));
<P>{{ "Number A is: " ~ numA}}<br>
{{ "Number B is: " ~ numB}}
</p>
Number A is: 1
Number B is: 9

String interpolation

<P>
{{ "A + B = #{numA + numB}"}}
</p>
A + B = 10

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store