How to Concatenate Two Strings in C#

How to Concatenate Two Strings in C# . In this program we can merge or add the string in the output. This is the process of combining something into something else that is more important, so that the lesser thing or right loses its individuality and becomes part of the larger whole. An agreement merges when it’s absorbed into another.

using System;

namespace Main
{
class Program
{
static void Main(string[] args)
{
string text = "Inlarn";
Console.WriteLine("Welcome to " + text);
}
}
}

 

Output:

Welcome to Inlarn

String Concatenate in C#

When you concatenate two strings, you are adding one string to the end of the other. Using the + operator, you can join strings together. There is no concatenation at runtime for string literals or string constants.

String Data Type in C#

A string is a String object with text as its value. A sequential read-only collection of Char objects is used to store the text. As there is no null-terminating character at the end of a C# string, any number of null characters (‘0’) can be embedded.