Ordering Array with LINQ

Rajesh_Kumar
Posted by Rajesh_Kumar under ASP.NET category on | Points: 40 | Views : 485
int[] arr_numbers = { 6, 7, 5, 4, 1, 2, 3, 0 };
var query = from item in arr_numbers
orderby item
select item;

int[] arr_numbers1 = query.ToArray();

foreach(int value in arr_numbers1)
{
Response.Write(value);
}

Output would be:-01234567

Comments or Responses

Login to post response