.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani

Home >> Code Snippets >> LINQ >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Sorting Array

Posted By:volvo       Posted Date: January 10, 2014    Points: 40    Category: LINQ    URL: http://www.dotnetspark.com  

Sorting Array using LINQ
 

Sorting Array using LINQ

using System;
using System.Linq;

class Program
{
    static void Main()
    {
	string[] a = new string[]
	{
	    "Indonesian",
	    "Korean",
	    "Japanese",
	    "English",
	    "German"
	};
	var sort = from s in a
		   orderby s
		   select s;

	foreach (string c in sort)
	{
	    Console.WriteLine(c);
	}
    }
}



     

Further Readings:

Responses
Author: abhays         Company URL: http://www.dotnetspark.com
Posted Date: January 10, 2014

its duplicate

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend