gistlib
There are several ways to join two strings in C#:
main.csstring str1 = "Hello"; string str2 = "World"; string result = str1 + " " + str2; //result: "Hello World" 105 chars4 lines
string str1 = "Hello"; string str2 = "World"; string result = str1 + " " + str2; //result: "Hello World"
main.csstring str1 = "Hello"; string str2 = "World"; string result = string.Concat(str1, " ", str2); //result: "Hello World" 118 chars4 lines
string str1 = "Hello"; string str2 = "World"; string result = string.Concat(str1, " ", str2); //result: "Hello World"
main.csstring str1 = "Hello"; string str2 = "World"; string[] strArray = { str1, str2 }; string result = string.Join(" ", strArray); //result: "Hello World" 150 chars5 lines
string str1 = "Hello"; string str2 = "World"; string[] strArray = { str1, str2 }; string result = string.Join(" ", strArray); //result: "Hello World"
gistlibby LogSnag