Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = Console.ReadLine();
- int number = 0;
- if(int.TryParse(input, out number)){
- // Assuming your enum is called "Planet"
- Planet planet = (Planet)number;
- switch(planet){
- case Planet.Earth:
- // etc...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment