Thursday, October 9, 2008

Merge two strings with C#

static void Main(string[] args)
{
string str1 = "hello";
string str2 = "kevin";
string str = string.Concat(str1," ",str2);//this is a good method to merge strings
Console.WriteLine(str);
string str3 = str1 + " " + str2;
Console.WriteLine(str3);
Console.WriteLine();
}

No comments: