I need to create a List<string>
with strings
of 50
length; like this results:
...0000000000
...0000000001
...000000000z
...0000000010
...000000001z
...00000000zz
...0000000100
...00000001zz
...zzzzzzzzzz
My code is
ConcurrentBag<string> bags = new ConcurrentBag<string>();
string schar = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (int a1 = 0; a1 < schar.length; a1++)
{
...
// 48 nested for loops here
...
for (int a50 = 0 ; a50 < schar.length ; a50++)
{
bags.add($"{schar[a1]}{schar[a2]}{schar[a3]}......to a50");
}
}
In this case, I can use 50
nested for loops to create this list, but the code is very unreadable. Is there any method to create this? Thanks.