c sharp generate random in array code example
Example 1: random value in array c#
Random random = new Random();
int value = random.Next(0, array.Length);
Console.Write(array[value]);
Example 2: get any random item in array c#
Object[] obj = { "this", "that", "those" };
Random rn = new Random();
Object ob = rn.Next(0, obj.Length);