当前位置:网站首页>C enum contains value - C enum contains value
C enum contains value - C enum contains value
2022-07-03 18:44:00 【fyin1314】
problem :
I have an enum I have an enumeration
enum myEnum2 { ab, st, top, under, below}
I would like to write a function to test if a given value is included in myEnum I want to write a function to test myEnum Whether the given value is included in
something like that: Something similar :
private bool EnumContainValue(Enum myEnum, string myValue){ return Enum.GetValues(typeof(myEnum)) .ToString().ToUpper().Contains(myValue.ToUpper()); }
But it doesn't work because myEnum parameter is not recognized. But it doesn't work , Because I can't recognize myEnum Parameters .
Solution :
Reference resources : https://stackoom.com/en/question/tadR边栏推荐
- ES7 - Optimization of promise
- What is SQL get connection
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
- Theoretical description of linear equations and summary of methods for solving linear equations by eigen
- Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time
- Compose LazyColumn 顶部添加控件
- Add control at the top of compose lazycolumn
- Grammaire anglaise Nom - Classification
- Gao Qing, Beijing University of Aeronautics and Astronautics: CIM is a natural quantum computing platform for graph data processing
- SQL custom collation
猜你喜欢
G1 garbage collector of garbage collector
my. INI file not found
Recommend a simple browser tab
English语法_形容词/副词3级 - 倍数表达
Leetcode: 11. Récipient contenant le plus d'eau [double pointeur + cupidité + enlèvement de la plaque la plus courte]
How many convolution methods does deep learning have? (including drawings)
虚拟机和开发板互Ping问题
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
leetcode:11. 盛最多水的容器【双指针 + 贪心 + 去除最短板】
How to read the source code [debug and observe the source code]
随机推荐
Pan for in-depth understanding of the attention mechanism in CV
Torch learning notes (4) -- torch's dynamic calculation diagram
leetcode:556. 下一个更大元素 III【模拟 + 尽可能少变更】
Getting started with JDBC
204. Count prime
User identity used by startup script and login script in group policy
Theoretical description of linear equations and summary of methods for solving linear equations by eigen
Torch learning notes (1) -- 19 common ways to create tensor
Nodejs (01) - introductory tutorial
论文阅读 GloDyNE Global Topology Preserving Dynamic Network Embedding
Common PostgreSQL commands
Computer graduation project PHP library book borrowing management system
Grammaire anglaise Nom - Classification
What is the function of registering DLLs- What does registering a DLL do?
Mysql45 lecture learning notes (II)
php-fpm的max_chindren的一些误区
Briefly describe the quantitative analysis system of services
Caddy server agent
Transformer T5 model read slowly
English语法_形容词/副词3级 - 倍数表达