Enumerable.Range by example
C# Enumerable.Range function generates sequence of numbers. This article explores details of the Range function as well as its use cases. Enumerable.Range overview It takes two arguments. First argument is the first number in sequence (e.g. 10, means that the first number in sequence is 10). Second argument is the number of items in sequence (e.g. 11 means that it will return 11 numbers). It returns IEnumerable<int> which contains generated sequence. Keep in mind that each subsequent number is incremented by 1, which also means that it’s in ascending order. This however can be changed with some Linq tricks (check examples below). ...