© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
10 replies
CoreVisional

How to put enum values in a list [SOLVED]

Hi, I'm quite new to C# and I'm still learning, but I'm tasked to debug a piece of code using C#, I managed to fix it but I have like a super long if statement that contains the same thing, except for the values of enum. I came from Python and usually, I'd just declare a list like
my_list = [1, 2]
my_list = [1, 2]
, but from what I found, I just need to use Enum.GetValues().
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

Similar Threads

✅ Outputting values from a list
C#CC# / help
3y ago
Duplicate enum values serialization problems
C#CC# / help
2y ago
✅ How to get values of list using reflection?
C#CC# / help
3y ago
How do I cast my enum to a list of custom object?
C#CC# / help
2y ago