Asked • 04/12/19

Multi-variable switch statement in c#?

I would like use a switch statement which takes several variables and looks like this: switch (intVal1, strVal2, boolVal3) { case 1, "hello", false: break; case 2, "world", false: break; case 2, "hello", false: etc .... } Is there any way to do something like this in C#? (I do not want to use nested switch statements for obvious reasons).

1 Expert Answer


Tyler P. answered • 04/12/19

4th Year Software Engineering Major

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.