Language

Enumerable.Shuffle(IEnumerable) Method

Definition

Shuffles the order of the elements of a sequence.

public:
generic 
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable ^ Shuffle(System::Collections::Generic::IEnumerable ^ source);
public static System.Collections.Generic.IEnumerable Shuffle(this System.Collections.Generic.IEnumerable source);
static member Shuffle : seq<'Source> -> seq<'Source>

Public Function Shuffle(Of TSource) (source As IEnumerable(Of TSource)) As IEnumerable(Of TSource)

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IEnumerable

A sequence of values to shuffle.

Returns

A sequence whose elements correspond to those of the input sequence in randomized order.

Remarks

Randomization is performed using a non-cryptographically-secure random number generator.

Applies to