© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
40 replies
Theos

❔ Switch case on Int type

Hey, so I have a class with variable
_type
_type
and I want to store a variable type in it (long, int, short, ubyte etc etc).
Later I want to do a switch on
_type
_type

something like
switch(_type)
{
  case long:
  case int:
}
switch(_type)
{
  case long:
  case int:
}

How can I do this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

cant convert type (int, int) to Vector2
C#CC# / help
2y ago
❔ C# Arrays/Switch case help
C#CC# / help
3y ago
✅ Switch Case Not Executing Properly
C#CC# / help
3y ago
❔ Assigning variables in switch case
C#CC# / help
4y ago