

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- How to concatenate two strings in Python?
- How to concatenate two strings in Golang?
- How to concatenate two strings using Java?
- C++ Program to Concatenate Two Strings
- How can we concatenate two strings using jQuery?
- How to concatenate strings in R?
- How to concatenate several strings in JavaScript?
- How to correctly concatenate strings in Kotlin?
- Concatenate strings in Arduino
- Concatenate Multiple Strings in Java.
- How to concatenate two arrays in java?
- How to concatenate Two Arrays in C#?
- How to concatenate two slices in Golang?
- Concatenate strings from two fields into a third field in MongoDB?
- How to concatenate two strings so that the second string must concatenate at the end of first string in JavaScript?
Advertisements