How to reverse all elements of an Array in .NET


If you have an array in your program and you want to quickly reverse its all elements you can use Reverse method of Array class as follows:

int[] data = { 1, 2, 3, 4, 5 }; 
Array.Reverse(data);

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Add Comment