📜  c# 随机数 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:47.685000             🧑  作者: Mango

代码示例6
// One string will be randomly picked and displayed 
Random rnd = new Random();
string[] secOptions = {"string one", "string two", "string three"};
int randomNuber = rnd.Next(0, 3);
string secText = secOptions[randomNuber];
Console.WriteLine(secText);