Range

Range works only with integers.

Range accepts a starting index and count:


using System;
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:


5 6 7 8 9
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.