How to Sort a simple Array using LINQ OrderBy Operator

Waqas Anwar
23 November 2009
9912 Views

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;