Copy Array in C#

In this article I will explain that how to Copy then sort in Array.
  • 3427

The Copy static method of the Array class copies a section of an array to another list. If you want to retain the original order in a parallel collection, you must first copy the elements to a new collection.

 

namespace demo_array

{

    class Program

    {

        static void Main(string[] args)

        {

            //Program that uses Array copy then sort

            string[] arraydata = { "Zaineb", "Manisha", "Rajiv","Ajay","Baba","kaka" };


            List<string> copydata = new List<string>(arraydata);


            Console.WriteLine(string.Join(",", arraydata));

        }

    }

}


Output


Zaineb, Manisha, Rajiv, Ajay, Baba, Kaka

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.