c# put variable into string code example
Example 1: c# write variable in string
int age = 22;
Console.WriteLine($"Age: {age}");
Example 2: insert variables into a string C#
// For Console.WriteLine() and Console.Write() do...
string var0 = "one";
string var1 = "two";
Console.WriteLine("{0} and {1}", var0, var1);
/* Outputs:
one and two