728x90
728x170

Enum 에 선언된 내용으로 string 을 변환 하고 싶을 때 아래와 같이 합니다.

 

EnumType testEnumType = (EnumType)Enum.Parse(typeof(EnumType), "변경할string", true)

 

예)

public enum EnumTestType

{

   A,

   B
}

 

EnumTestType testEnumType = (EnumTestType)Enum.Parse(typeof(EnumTestType), "A", true)

728x90
그리드형
Posted by kjun
,