CSharp - Use condition with LongCount operator

Description

Use condition with LongCount operator

Demo

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
class Program/*from w w  w  .ja  v a  2  s. c  o m*/
{
    static void Main(string[] args)
    {
        long count = Enumerable.
                        Range(0, int.MaxValue).
                        Concat(Enumerable.Range(0, int.MaxValue)).
                        LongCount(n => n > 1 && n < 4);
        
        Console.WriteLine(count);
    }
}

Result

Related Topic