[Solved] How can I randomly select from prewritten strings in C#? [closed]


You can make an array of your string value and pick the random value from array.

// String array like in below format.

string [] stringArray = new [] {"A", "B", "C", "D", "E", "F"}; // Make it accordingly

int ramdomNum = random.Next(0, stringArray.Length);

Console.Write(stringArray[ramdomNum]);

Hope this will help you.

solved How can I randomly select from prewritten strings in C#? [closed]