String interpolation: Difference between revisions

Content deleted Content added
Visual Basic: fix syntaxhighlight error
TypeScript: fix syntaxhighlight errors
Line 430:
 
As of version 1.4, [[TypeScript]] supports string interpolation using backticks <code>``</code>. Here is an example:
<syntaxhighlight lang="ecmascripttypescript">
var apples: number = 4;
console.log(`I have ${apples} apples`);
Line 437:
<syntaxhighlight lang="output">I have 4 apples</syntaxhighlight>
The <code>console.log</code> function can be used as a <code>printf</code> function. The above example can be rewritten, thusly:
<syntaxhighlight lang="ecmascripttypescript">
var apples: number = 4;
console.log("I have %d apples", apples);