How to Sort a simple Array using LINQ OrderBy Operator


You have a simple Array and you want to sort it using LINQ standard OrderBy operator

string[] words = { "cherry", "apple", "blueberry" };
var sortedWords =
    from w in words
    orderby w
    select w;

 

 

About author


User avatar

Waqas Anwar

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

Comments