C# 遍历枚举(枚举是目的,遍历(获取)是手段)
2021-05-15 12:49
阅读:478
标签:string logs type ring get img body tool title
C#中,如何获取(遍历)枚举中所有的值:

public enum Suits { Spades, Hearts, Clubs, Diamonds, NumSuits } private static void Main(string[] args) { foreach (Suits suit in Enum.GetValues(typeof(Suits))) { Console.WriteLine((int)suit+ ":" + suit); } }

转载:https://www.cnblogs.com/zhangzhi19861216/p/5362090.html
C# 遍历枚举(枚举是目的,遍历(获取)是手段)
标签:string logs type ring get img body tool title
原文地址:https://www.cnblogs.com/chengqi521/p/8243016.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:C# 遍历枚举(枚举是目的,遍历(获取)是手段)
文章链接:http://soscw.com/index.php/essay/85760.html
文章标题:C# 遍历枚举(枚举是目的,遍历(获取)是手段)
文章链接:http://soscw.com/index.php/essay/85760.html
评论
亲,登录后才可以留言!