Skip to content

Instantly share code, notes, and snippets.

@swkwon
Created January 6, 2014 08:07
Show Gist options
  • Save swkwon/8279704 to your computer and use it in GitHub Desktop.
Save swkwon/8279704 to your computer and use it in GitHub Desktop.
concat2
static void Main(string[] args)
{
// To run this program, provide a command line string.
// In Visual Studio, see Project > Properties > Debug.
string userName = args[0];
string date = DateTime.Today.ToShortDateString();
// Use the + and += operators for one-time concatenations.
string str = "Hello " + userName + ". Today is " + date + ".";
System.Console.WriteLine(str);
str += " How are you today?";
System.Console.WriteLine(str);
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment