Contents contributed and discussions participated by karan Chanana
How to: Join Multiple Strings (C# Programming Guide) - 0 views
-
How to: Join Multiple Strings (C# Programming Guide)
string two = "karan";
string str = "chanana " + karan + "k";
System.Console.WriteLine(str);
The following code uses the Append method of the StringBuilder class to join three strings without the chaining effect of the + operator.
class StringBuilderTest
{
static void Main()
{
string karan = "karan";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("chanana ");
sb.Append(karan);
sb.Append(" k");
System.Console.WriteLine(sb.ToString());
string str = sb.ToString();
System.Console.WriteLine(str);
}
}
Tag , karan chanana , c , c++ , karan
1 - 2 of 2
Showing 20▼ items per page