Wednesday, 30 October 2013

Check Index Value is less than their Value with Linq

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

namespace linq___
{
    class Program
    {

        static void Main(string[] args)
        {
// Checking wheather the value is less than their index value

            Console.WriteLine("\n checking of string");

            String[] srr = { "zero", "one", "two", "three", "four", "five", "six" };

            var check = srr.Where((digit, index) => digit.Length < index);

            foreach (var item in check)
            {
                Console.WriteLine(item);
           
            }


// Program is made by Jaspreet Singh

         

        }
    }
}

0 comments:

Post a Comment