Edit

Share via


Enumerable.Sequence<T>(T, T, T) Method

Definition

Generates a sequence that begins with start and yields additional values each incremented by step until endInclusive is reached.

public:
generic <typename T>
 where T : System::Numerics::INumber<T> static System::Collections::Generic::IEnumerable<T> ^ Sequence(T start, T endInclusive, T step);
public static System.Collections.Generic.IEnumerable<T> Sequence<T>(T start, T endInclusive, T step) where T : System.Numerics.INumber<T>;
static member Sequence : 'T * 'T * 'T -> seq<'T (requires 'T :> System.Numerics.INumber<'T>)> (requires 'T :> System.Numerics.INumber<'T>)
Public Function Sequence(Of T As INumber(Of T)) (start As T, endInclusive As T, step As T) As IEnumerable(Of T)

Type Parameters

T

The type of the value to be yielded in the result sequence.

Parameters

start
T

The starting value. This value will always be included in the resulting sequence.

endInclusive
T

The ending bound beyond which values will not be included in the sequence.

step
T

The amount by which the next value in the sequence should be incremented from the previous value.

Returns

An IEnumerable<T> that contains the sequence.

Exceptions

start is null.

endInclusive is null.

step is null.

endInclusive is NaN.

step is greater than zero but endInclusive is less than start.

step is less than zero but endInclusive is greater than start.

step is zero and endInclusive does not equal start.

Applies to