If I have a function
void Foo(params int[] bar){}
The following runs fine:
int[] a1 = {1, 2, 3};
int[] a2 = {4, 5, 6};
Foo(1, 2, 3);
Foo(a1);
But these give compile errors:
Foo(a1, 1, 2, 3);
Foo(1, 2, a1);
Foo(1, a1, 2);
Foo(a1, a2, 1, 2, 3);
because only the first argument is allowed to be an int[], the rest have to be ints.
The final example is what I would like to do, but the language won't let me without combining the arrays first. I really like the simplicity of the syntax, and I would rather not add to the code more than I have to. Does anyone have a nice way to do this?