If the collection where strings
are accessible by You can always do:
var rand = new Random();
// Caso seja um array
var nextRandString = rand.Next(0, tamanhoArray -1);
// Caso seja uma lista
var nextRandString = rand.Next(0, lista.Count - 1);
And use the random value to choose the string:
var arrayString = new string[5];
var randString = arrayString[nextRandString];
var listString = new List<string>();
var randString = listString[nextRandString];
If it’s an operation you want to use multiple times you can always define a extension method
extracting the random element (in this example defined for any type of element):
private static readonly Random _rand = new Random();
public static T GetRandomString<T>(this ICollection<T> source)
{
var randIndice = _rand.Next(0, source.Count - 1);
return source.ElementAt(randIndice);
}
Edit: Regarding speed, since access is done by Dice the complexity is O(1).