Generation

generate functionSun, 13 Nov 2022

Extract a random number of values from a list, without repetitions

static void Main() { Random rnd = new Random(); string[] array = { "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" }; int index = rnd.Next(array.Length); string randomValue = array[index]; Console.WriteLine(randomValue); }

Questions about programming?Chat with your personal AI assistant