System.Linq.Enumerable.Range Method

Generates a sequence of integral numbers within a specified range.

Syntax

public static IEnumerable<int> Range (int start, int count)

Parameters

start
The value of the first integer in the sequence.
count
The number of sequential integers to generate.

Returns

An IEnumerable<Int32> in C# or IEnumerable(Of Int32) in vbprvb that contains a range of sequential integral numbers.

Remarks

This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.

Requirements

Namespace: System.Linq
Assembly: System.Core (in System.Core.dll)
Assembly Versions: 3.5.0.0, 4.0.0.0