C#/Winform
(.NET) string 를 enum Type 로 변경하기
kjun.kr
2017. 4. 15. 14:52
728x90
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