Answers for "sting interpolation"

C#
4

f string C#

string name = "John"
Console.WriteLine($"Hello {name}")
Posted by: Guest on June-16-2020
0

string interpolation

/*In order to embed expressions within normal strings,
you would use the following syntax:*/
let a = 5;
let b = 10;
console.log('Fifteen is ' + (a + b) + ' andnnot ' + (2 * a + b) + '.');
// "Fifteen is 15 and
// not 20."

/*Now, with template literals, you are able to make use of the syntactic sugar,
making substitutions like this more readable:*/
let a = 5;
let b = 10;
console.log(`Fifteen is ${a + b} and
not ${2 * a + b}.`);
// "Fifteen is 15 and
// not 20."
Posted by: Guest on January-11-2021

C# Answers by Framework

Browse Popular Code Answers by Language