RandomListExtensions.

Choose<T>(Random, IList<T>) Method

Summary

Chooses a random item.

Syntax

public static T Choose<T>(this Random random, IList<T> collection)

Type Parameters

Name Description
T

Parameters

Name Type Description
random Random An instance of System.Random.
collection IList<T> Collection to choose item from.

Return Value

Type Description
T A random item from collection