Range

In this chapter you will learn:

  1. How to use Range operator

Get to know Range operator

using System;//from  j  a v a 2 s.c  om
using System.Collections;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        foreach (int i in Enumerable.Range(5, 5))
        {
            Console.Write(i + " "); // 5 6 7 8 9
        }
    }
}

The output:

Next chapter...

What you will learn in the next chapter:

  1. How to use Repeat operator
Home » C# Tutorial » Linq Operators
Aggregate
Aggregate with seed
Aggregate string value
All
Any
Average
Cast
Concat
Contains
Count
DefaultIfEmpty
Distinct
ElementAt
ElementAtOrDefault
Empty
Except
FindAll
First
FirstOrDefault
GroupBy
Intersect
Last
LastOrDefault
LongCount
Max
Min
OfType
OrderBy
OrderByDescending
Range
Repeat
Reverse
SelectMany
SequenceEqual
Single
SingleOrDefault
Skip
SkipWhile
Sum
Take
TakeWhile
ThenBy
ThenByDescending
ToArray
ToList
Zip