![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
C# program to join words into a string in C#
Declare a string and add elements −
string[] str = { "One", "Two", "Three", "Four", "Five" };
Use the Join() method to join the words−
string res = string.Join(" ", str);
Let us see the complete code −
Example
using System; public class Demo { public static void Main() { string[] str = { "One", "Two", "Three", "Four", "Five" }; // join words string res = string.Join(" ", str); Console.WriteLine(res); } }
Output
One Two Three Four Five
Advertisements