c# random function only picks the first 3 out of 5 arrays

0
26

I’m trying to make a random alphabet selector using arrays and Random. but the random.Next function only picks the first 3 arrays out of 5 arrays.

char[] vowel = { 'a', 'e', 'i', 'o', 'u' };
    Random random = new Random();
    int select = random.Next(0, vowel.Length);
    textBox1.Text = vowel[select].ToString();

The output will always be “a”, “e”, or “i”; but never “o” and “u”.

Sorry for bad english.

LEAVE A REPLY

Please enter your comment!
Please enter your name here