Q:

Write a C# Sharp program to concatenate the array values of strings

0

Write a C# Sharp program to concatenate the array values of strings. 

Expected Output :

hello welcome to C# Sharp create Windows client applications                     
                                                                                 
hello applicationsC# Sharp client create to welcome Windows

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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));
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now