
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
How to concatenate two strings in C#?
To concatenate two strings, use the String.Concat method.
Let’s say you want to concatenate two strings in C#, str1 and str2, then add it as arguments in the Concat method −
string str3 = string.Concat(str1, str2);
Example
The following is the example −
using System; class Program { static void Main() { string str1 = "Brad"; string str2 = "Pitt"; // Concat strings string str3 = string.Concat(str1, str2); Console.WriteLine(str3); } }
Output
BradPitt
- Related Articles
- C++ Program to Concatenate Two Strings
- How to concatenate two strings in Python?
- How to concatenate two strings in Golang?
- How to concatenate two strings using Java?
- How to concatenate strings in R?
- How can we concatenate two strings using jQuery?
- How to concatenate Two Arrays in C#?
- How to concatenate several strings in JavaScript?
- How to correctly concatenate strings in Kotlin?
- How to concatenate multiple C++ strings on one line?
- C++ program to concatenate strings in reverse order
- Build complete path in Linux by concatenate two strings?
- Concatenate strings in Arduino
- How to concatenate two strings so that the second string must concatenate at the end of first string in JavaScript?
- How to join or concatenate two lists in C#?

Advertisements