Answers for "How to combine variables and string in one printer in c#"

C#
0

How to combine variables and string in one printer in c#

string userName = "<Type your name here>";
string dateString = DateTime.Today.ToShortDateString();

// Use the + and += operators for one-time concatenations.
string str = "Hello " + userName + ". Today is " + dateString + ".";
System.Console.WriteLine(str);

str += " How are you today?";
System.Console.WriteLine(str);
Posted by: Guest on July-21-2021

Code answers related to "How to combine variables and string in one printer in c#"

C# Answers by Framework

Browse Popular Code Answers by Language