First Select Prototype : Prototype « LINQ « C# / C Sharp






First Select Prototype

 


using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {
        string[] presidents = {"A", "Ar", "Buc", "Bush", "Carte", "Clevel"};

        var nameObjs = presidents.Select(p => new { p, p.Length });

        foreach (var item in nameObjs)
            Console.WriteLine(item);
    }
}

 








Related examples in the same category

1.Where by Prototype
2.Select Prototype: string length
3.Second Select Prototype