我未能将List<string>
转换为List<myEnumType>
。我不知道为什么?如何将列表<string>转换为列表<myEnumType>?
string Val = it.Current.Value.ToString(); // works well here
List<myEnumType> ValList = new List<myEnumType>(Val.Split(',')); // compile failed
定义为字符串枚举类型,因为这原因myEnumType
类型,
public enum myEnumType
{
strVal_1,
strVal_2,
strVal_3,
}
这有什么错?赞赏你的回复。
@All,看起来这不是一个愚蠢的问题。再次感谢所有快速回复。我会练习任何解决方案,只是把它作为我的学习案例。 – 2010-12-13 07:26:46