I have this simple code:
var result = Enumerable.Range(1, 100000000).ToArray();
var range = string.Join("", result);
What I am trying to do is generate all digits on a range of (1 to 10^8
) or (1 to 100000000
)
So in order to do that, I use Enumerable.Range but I get an exeption on the second line of my code which is joining them after the range was made.
I get:
Exception of type 'System.OutOfMemoryException' was thrown.
I need to get:
1234567891011121314... and so on. (without space)
Any idea why?