Java Learners
Arrays can be termed as a collection of similar data types, indexed by the nature. An array can be of type integer,Strings or any data type. The array class is derived from System.Array.* .
C# defines many operations which can be performed on any Array class. An array of String class can be defined as :
String[] arrayToBeSorted = { "Deepak","gupta","knows","Sharp" };

Now I will show how to sort and reverse sort this array string using C#.

Open up a console windows application as shown in First Example , and type the following code :
using System; using System.Collections.Generic; using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
    {
        public static void SortMyArray(object[] sortArray)
        {
             foreach (object obj in sortArray)
                {
                    Console.WriteLine("Value: {0}",obj);
                }
            Console.WriteLine("\n");
         }
 static void Main(string[] args)
    {
        String[] arrayToBeSorted =
                { "Deepak","gupta","knows","Sharp" };
    SortMyArray(arrayToBeSorted);
Array.Reverse(arrayToBeSorted);
    SortMyArray(arrayToBeSorted);
 System.Console.ReadLine();
}
 }
 }
Running this program and check the output.

Looking for Something more ... check the google
Comment Comment By Datetime

Drop a Comment

Comment
Name
Mail ID
Phone number