I have the following C# code:
AnimalTypeEnum animal; string s = Console.ReadLine(); switch (s.ToLower()) { case \"dog\": animal = AnimalTypeEnum.DOG;
AnimalTypeEnum animal; var s = Console.ReadLine(); Console.WriteLine(!Enum.TryParse(s, true, out animal) ? "Not a valid animal" : animal.ToString());