C#C
C#3y ago
sebt

❔ C# Arrays/Switch case help

Hi guys,
I was just wondering if anybody here would be willing to potentially message me or hop in a voice call if they know a solution to my issue.
The issue is as follows:
Basically, I currently have a menu system that asks the user for an input, I then have a 2D array consisting of information that will be displayed depending on the user's input,
However, I am currently using a switch case like case "1" do this, case "2" do that, and this approach is for 8 different scenarios and thus is around 160lines long of just repeated console.writeline jargon. Since the user input is equal to one of the elements of the array, I was wondering if there was a shorter way of writing this so that my code would detect the user input, match that to its corresponding element in the array, and then print every element of said array.
If anybody could think of a solution and help me I would seriously appreciate it.
Was this page helpful?