Arraylist Reverse

vishalneeraj-24503
Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 1243
With the help of Reverse() method of ArrayList,we can Reverse Items in ArrayList.

For Example:-
System.Collections.ArrayList arr_list = new System.Collections.ArrayList();
arr_list.Add("Vishal");
arr_list.Add("Rajesh");
arr_list.Add("Nitin");
arr_list.Add("Vipin");
arr_list.Add("Ramesh");

arr_list.Reverse();

foreach (string items in arr_list)
{
Response.Write(items + "<br/>");
}

Output:-

Ramesh
Vipin
Nitin
Rajesh
Vishal

Comments or Responses

Login to post response