lunedì 14 ottobre 2013

How To: Lamba on String

E' bello fare certe scoperte... ( SOLO DOPO ) !

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LambdaString
{
    class Program
    {
        static void Main(string[] args)
        {
            string Test1 = "questo è uno splendido testo";
            var cTest1 = Test1.ToCharArray().Where(c => c == 'n');
            Console.WriteLine(cTest1.Count());

           
        }
    }
}
E ammetto che ci ho pure provato gusto !
Quello che mi fa sorridere e il non averci mai pensato eppure è li bello ovvio come il sole !

Le stringhe sono array e come tali sono riconducibili ad un Querable Object.. e via .. 

Nessun commento: