Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Get Enum Name

//Option 1:
string m = Enum.GetName(typeof(MyEnumClass), value);
//Option 2:
string n = nameof(MyEnumClass.Value);
Comment

Get Enum Name


int value = GetValueFromDb();
var enumDisplayStatus = (EnumDisplayStatus)value;
string stringValue = enumDisplayStatus.ToString();

Comment

get enum name

string[] nameList=  System.Enum.GetNames(typeof(Word));
        foreach (var name in nameList)
        {
            print(name);//获取名称
        }
1
2
3
4
5
Comment

PREVIOUS NEXT
Code Example
Csharp :: difference two list c# 
Csharp :: https request c# 
Csharp :: C# type cast float to string 
Csharp :: c# get type of object 
Csharp :: gameobject in unity c# 
Csharp :: o(n*m) 
Csharp :: c# windows forms print 
Csharp :: c# remove items from one list that are in another 
Csharp :: get device connected to player input unity 
Csharp :: letter at index of string c# 
Csharp :: assign color to value in c# 
Csharp :: c# save pdf to folder 
Csharp :: c# dictionary get value by key 
Csharp :: c# connect tcp 
Csharp :: c# Get type with namespace 
Csharp :: what is type unity 
Csharp :: find genre of song 
Csharp :: c# bitmap to array byte 
Csharp :: html.beginform 
Csharp :: how to run async void function c# 
Csharp :: relative path c# 
Csharp :: c# read last 10 lines of file 
Csharp :: create list in c# 
Csharp :: unity check gameobject active 
Csharp :: change column name in datatable C# 
Csharp :: aspx import namespace 
Csharp :: arcane 
Csharp :: what are access modifiers in c# 
Csharp :: c# file watcher 
Csharp :: C# network traffic 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =