Answers for "string to enum description c#"

C#
1

String to enum C#

string str = "Dog";
Animal animal = (Animal)Enum.Parse(typeof(Animal), str);  // Animal.Dog
Animal animal = (Animal)Enum.Parse(typeof(Animal), str, true); // case insensitive
Posted by: Guest on August-05-2021
0

c# string to enum

MyEnum enumValue = Enum.Parse<MyEnum>(stringValue);
Posted by: Guest on January-18-2022

C# Answers by Framework

Browse Popular Code Answers by Language