This article describes the usage of array initialization, inversion and sorting in C#. Share it for your reference. The details are as follows:
The following code demonstrates how to define and initialize an array in C#, and then assign, sort and invert it:
using System; public class ArraySample { public static void Main() { // Create and initialize a new array instance. Array strArr = (typeof(string), 3); ("Mahesh", 0); ("chand", 1); ("Test Array", 2); // Display the values of the array. ("Initial Array values:"); for(int i = (0);i<=(0);i++) ((i)); //sort the value of the array. (strArr); ("After sorting:"); for(int i = (0);i<=(0);i++) ((i)); // Reverse values of the array. (strArr); for(int i = (0);i<=(0);i++) ((i)); } }
I hope this article will be helpful to everyone's C# programming.