📜  生成随机数 c# Code Example

📅  最后修改于: 2022-03-11 14:49:05.737000             🧑  作者: 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);