MoreEnumerableSequence(Int32, Int32, Int32) Method
Generates a sequence of integral numbers within the (inclusive) specified range.
An additional parameter specifies the steps in which the integers of the sequence increase or decrease.
Namespace: MoreLinqAssembly: MoreLinq (in MoreLinq.dll) Version: 4.4.0+6d97c3b1d482f98300f4446df14742b0e3fafbec
public static IEnumerable<int> Sequence(
int start,
int stop,
int step
)
Public Shared Function Sequence (
start As Integer,
stop As Integer,
step As Integer
) As IEnumerable(Of Integer)
public:
static IEnumerable<int>^ Sequence(
int start,
int stop,
int step
)
static member Sequence :
start : int *
stop : int *
step : int -> IEnumerable<int>
- start Int32
- The value of the first integer in the sequence.
- stop Int32
- The value of the last integer in the sequence.
- step Int32
- The step to define the next number.
IEnumerableInt32An
IEnumerableT that contains a range of sequential integral numbers.
When step is equal to zero, this operator returns an
infinite sequence where all elements are equal to start.
This operator uses deferred execution and streams its results.
var result = MoreEnumerable.Sequence(6, 0, -2);
The
result variable will contain
{ 6, 4, 2, 0 }.