Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

concatenate
strings
two
c#

How to concatenate two strings in C#

Educative Answers Team

Concatenation is the process of appending one string to the end of another. In C#, any two strings can be concatenated using the + operator.

svg viewer

Code

The code snippet below illustrates the process of concatenating two strings in C#:

class HelloWorld
{
    static void Main()
    {
      string FirstString = "Hello";
      string SecondString = "World";

      string ConcatenatedString = FirstString + SecondString;
      
      System.Console.WriteLine(ConcatenatedString);
    }
}

RELATED TAGS

concatenate
strings
two
c#
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring