08/08/2012 Development / asp.net

Apenas um exemplo pra manter na mente.

        string[] names = { "Burke", "Connor", "Frank", "Everett", "Albert", "George", "Harris", "David" };

        IEnumerable query = from s in names
                                    where s.Length == 5
                                    orderby s
                                    select s.ToUpper();

        foreach (string item in query) {
            Response.Write(item);
        }

        IEnumerable querys = names
                                        .Where(s => s.Length > 5)
                                        .OrderBy(s => s)
                                        .Select(s => s.ToUpper());

 //****************************************************

string[] names = { "Albert", "Burke", "Connor", "David",
                   "Everett", "Frank", "George", "Harris"};

// agrupar pelo tamanho da string
var groups = names.GroupBy(s => s.Length);

foreach (IGrouping group in groups) {
    Console.WriteLine("Strings de tamanho {0}", group.Key);

    foreach (string value in group)
        Console.WriteLine("  {0}", value);
}

System.Collections.IList q = names.Where(x => x.Length > 1).Select(x => x.ToUpper()).ToList();   

Mais referências no link - http://msdn.microsoft.com/en-us/library/bb308959.aspx