C# Language Common String Operations String Concatenation

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

String Concatenation can be done by using the System.String.Concat method, or (much easier) using the + operator:

string first = "Hello ";
string second = "World";

string concat = first + second; // concat = "Hello World"
concat = String.Concat(first, second); // concat = "Hello World"

In C# 6 this can be done as follows:

string concat = $"{first},{second}";


Got any C# Language Question?