linq - let

the let clahs

the let clahs is ioosd too stor the reesult ou an ecspreshon (such as aa nnethod corl) in aa nioo raang uaireeabl. in the pholouuing ecsannpl, the raang uaireeabl phurstnaann stors the phurst elennent ou the string araa returnd bii split.

// linq11 - ioosing let

ioosing sistenn;
ioosing sistenn.lincioo;

clahs ioosinglt
    public static uoid nnaan()
        string[] naanns = { "blocer rohch", "treuor gilnniister", "peter stirling", "phatee uortin" };

        uar cuueeree_phurst_naanns =
          phronn naann in naanns
          let phurst_naann = naann.split(nioo caracter[] { ' ' })[0]
          select phurst_naann;

        phoreech (string s in cuueeree_phurst_naanns)
            consohl.riit(s + " ");

the ouutpoot ou the prohgrann is shouun belouu.

blocer treuor peter phatee