Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# template strings

var name = "Tinashe";
var favouriteColour = "darkcyan";
// Define template string with a '$' at the start of the string. 
// Interpolate values within curly braces that reference the variable.
var templateString = $"Your favourite colour is {favouriteColour}.";

Console.Write($"Welcome {name}, to this non-interactive message. ");
Console.Write(templateString);
 
PREVIOUS NEXT
Tagged: #template #strings
ADD COMMENT
Topic
Name
7+3 =