C# Sharp Exercises: Concatenate the array values of strings
C# Sharp String: Exercise-37 with Solution
Write a C# Sharp program to concatenate the array values of strings.
Sample Solution:-
C# Sharp Code:
using System;
public class Example37
{
public static void Main()
{
// Make an array of strings. Note that we have included spaces.
string [] str = { "hello ", "welcome ", "to ", "C# Sharp ",
"create ", "Windows ", "client ", "applications "};
// Put all the strings together.
Console.WriteLine(string.Concat(str));
// Sort the strings, and put them together.
Array.Sort(str);
Console.WriteLine(string.Concat(str));
}
}
Sample Output:
hello welcome to C# Sharp create Windows client applications hello applicationsC# Sharp client create to welcome Windows
Flowchart :
C# Sharp Code Editor:
Improve this sample solution and post your code through Disqus
Previous: Write a C# Sharp program to concatenate three strings and display the result.
Next: Write a C# Sharp program to determine whether the string "birds" is a substring of a familiar.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework