Answers for "c# get enum name from int"

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
1

c# get enum name from value

string name=(weekdays)2;//returns weekdays which has value 2.Here weekdays is enum name
Posted by: Guest on March-03-2021

C# Answers by Framework

Browse Popular Code Answers by Language