Skip to content

PickRandom Method ​

Definition ​

  • Namespace: JASE.Extensions
  • Assembly: JASE.Primitives.dll

Overloads ​

NameDescription
T PickRandom(IEnumerable<T> source)Returns a randomly selected item from the source
IEnumerable<T> PickRandom(IEnumerable<T> source, int count)Returns a randomly selected list item from the source
T PickRandom(IList<T> source, bool remove = null)Returns a randomly selected item from the source
List<T> PickRandom(IList<T> source, int count, bool remove = null)Returns a randomly selected list item from the source

T PickRandom(IEnumerable<T> source) ​

csharp
T PickRandom(IEnumerable<T> source)

Returns a randomly selected item from the source

IEnumerable<T> PickRandom(IEnumerable<T> source, int count) ​

csharp
IEnumerable<T> PickRandom(IEnumerable<T> source, int count)

Returns a randomly selected list item from the source

T PickRandom(IList<T> source, bool remove = null) ​

csharp
T PickRandom(IList<T> source, bool remove = null)

Returns a randomly selected item from the source

List<T> PickRandom(IList<T> source, int count, bool remove = null) ​

csharp
List<T> PickRandom(IList<T> source, int count, bool remove = null)

Returns a randomly selected list item from the source