Answers for "get enum key from value c#"

C#
0

get key from c# enum for specific value

enum myEnum { firstValue: 1, secondValue 2, thirdValue = 3};
string text = Enum.GetName(typeof(myEnum), 2); // text is "secondValue"
Posted by: Guest on October-27-2020

C# Answers by Framework

Browse Popular Code Answers by Language