Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to print a variable in c# with text

string name = "John";
Console.WriteLine("His name is " + name);
// or
Console.WriteLine($"His name is {name}");
// or
Console.WriteLine("His name is ", name);
// or 
Console.WriteLine("His name is {0}", name);
 
PREVIOUS NEXT
Tagged: #print #variable #text
ADD COMMENT
Topic
Name
1+5 =