Sorting values with Linq Extension using OrderBy clause.

vishalneeraj-24503
Posted by vishalneeraj-24503 under LINQ category on | Points: 40 | Views : 345
int[] input_values = { 8, 4, 7, 10, 5, 6, 7, 12, 9 };
var result = input_values.OrderBy(g => g);
foreach (var val in result)
{
Response.Write(val + " ");
}

Output:
4 5 6 7 7 8 9 10 12

Comments or Responses

Login to post response