Return int between 0 and 10 using Range in CSharp

Description

The following code shows how to return int between 0 and 10 using Range.

Example


    /*w  w  w  .  jav  a  2 s . c om*/

using System;
using System.ComponentModel;
using System.Linq;

    class MainClass
    {
        static void Main()
        {
            var collection = Enumerable.Range(0, 10);

            foreach (var element in collection)
            {
                Console.WriteLine(element);
            }
        }
    }

The code above generates the following result.





















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ