- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the operator that concatenates two or more string objects in C#?
Use operator + to concatenate two or more string objects.
Set the first string object.
char[] c1 = { 'H', 'e', 'n', 'r', 'y' }; string str1 = new string(c1);
Now, set the second string object.
char[] c2 = { 'J', 'a', 'c', 'k' }; string str2 = new string(c2);
Now display the concatenated strings using + operator.
Example
using System.Text; using System; class Program { static void Main() { char[] c1 = { 'H', 'e', 'n', 'r', 'y' }; string str1 = new string(c1); char[] c2 = { 'J', 'a', 'c', 'k' }; string str2 = new string(c2); Console.WriteLine("Welcome " + str1 + " and " + str2 + "!"); } }
Output
Welcome Henry and Jack!
- Related Articles
- Apply gravity between two or more objects in HTML5 Canvas
- How to use spread operator to join two or more arrays in JavaScript?
- Combination of two or more elements is called what?
- C++ Program to Find the Shortest Supersequence that Contains Two or more Sequences as Subsequences
- Check if two String objects have the same value in C#
- The mass of object A is 6kg whereas that of another object B is 34 kg. Which of the two objects A or B has more inertia?
- What is the ?-->? operator in C++?
- What is Logical OR Operator (||) in JavaScript?
- What is Bitwise OR Operator (|) in JavaScript?
- C# program to concat two or more Lists
- What is JavaScript Bitwise OR (|) Operator?
- What is the operator precedence in C#?
- What is Bitwise OR Assignment Operator (|=) in JavaScript?
- Check if two StringDictionary objects are equal or not in C#
- What is a Ternary operator/conditional operator in C#?

Advertisements