I am looking for a concise way to generate an array of integers 1 to 100 in c# , ie
int[] values = {1,2,3 ..., 100};
so that I can use the array in a foreach loop:
foreach (var i in values)
{
// do whatever
}
Any ideas?
Using
Enumerable.Range: