Supposedly I have 5 variables (a,b,c,d,e) and what I want to make a now is a string array that contains something like this

string[] result;
result[0]= result = a + "_" b + "_" + c + "_" + d + "_" + e;

and the next index would be the permutation of all 5 possible combinations. I know that the result would be a 120 long and how I learned to do that is by doing this one

for(int i=0;.....){
    for(int j=0;.....){
        //DO SOMETHING HERE
    }
}

But is there any quicker way to do this? Much help appreciated.

0 Answers