C# 从数组中随机抽取

C# 从数组中随机抽取
        static void Main(string[] args)
        {
            string[] str = new string[] { "135", "136", "137", "138", "139", "150", "151", "158", "159", "130", "131", "155", "156", "186", "133", "153", "181", "189" };

            Random rnd = new Random(Guid.NewGuid().GetHashCode());
            for (int i = 0; i < 50; i++)
            {
                Console.WriteLine(str[rnd.Next(str.Length)]);
            }

            Console.ReadKey();
        }

作者最新文章
C# 使用 CSVHelper 操作 csv 文件, .net core, .net framework 读取写入 csv 文件
C# 实现字符串文本换行的方法,文本如何换行
C# 如何循环读取文件每一行文本内容
C# DateTime AddMonths 的错误用法导致跳过日期
C# 全角转换半角,半角转换为全角