generate random number array c# 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: randomize through array in C#
using System;
using System.Collections.Generic;
namespace whatever_you_want
{
public class Randomizer
{
public static T Randomize<T>(List<T> array)
{
Random rnd = new Random();
return array[rnd.Next(0, array.Count)];
}
}
}