stackoverflow1453

Programming&&Games&&Life

Archive for Linq

Linq

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

namespace ConsoleApplication16
{
    class Program
    {
        static void Main(string[] args)
        {
            // implicitly typed local variable
            var aray = new[] { 32, 443, 3, 5, 5, 2, 64, 6, 5645, 3 };

            var sorted =
                    from value in aray
                    where value > 5 && value < 400
                    select value;
            //printing out sorted

            Console.WriteLine("Printing out sorted");
            foreach (var item_ in sorted)
            {
                Console.WriteLine(item_);
            }
        }
    }
}