19
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
5
public class Program
6
{
7
public static void Main()
8
{
9
// Initialize our list
10
List<string> mylist = new List<string>(new string[] { "biology-1", "biology-2", "biology-3" });
11
12
Random R = new Random();
13
14
// get random number from 0 to 2.
15
int someRandomNumber = R.Next(0, mylist.Count());
16
17
Console.WriteLine("Hello {0}", mylist.ElementAt(someRandomNumber));
18
}
19
}
Cached Result
Hello biology-2