© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
283 replies
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ c# winforms toggle switch help
C#CC# / help
3y ago
❔ Switch-case on byte as characters like in C
C#CC# / help
3y ago
✅ Switch Case Not Executing Properly
C#CC# / help
3y ago
❔ Switch case on Int type
C#CC# / help
3y ago