Thursday

Code - Generate Integral Numbers Within Specified Range

Simple yet effective line of following code will generate a sequence of integral number within a specified range:

int startNumber = 0;
int count = 11
IEnumerable a = Enumerable.Range(startNumber, count);

The result from the above line of code will be something like:

0 1 8 6 7 10 3 5 4 9 2

No comments:

Post a Comment

Your comments are highly appreciated!