Answers for "insert variables into a string C#"

C#
6

insert variables into string c#

string data = "Mr. Rogers";
var str = $"Hello {data}, how are you doing?";
Posted by: Guest on February-22-2020
0

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
Posted by: Guest on October-29-2020

C# Answers by Framework

Browse Popular Code Answers by Language