[英]Get the string name of an enumeration or class without namespace?
所以,我想得到枚舉或類的名稱,而不在其前面附加完整的命名空間...例如:
enum MyEnum {
// enum values here
}
// somewhere else in the code
string testString = ???? // ???? returns "MyEnum"
typeof(MyEnum)
主要工作,但枚舉的命名空間附加到前面。
任何幫助將不勝感激...謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.