EnumerableExtensionsShuffleT(IEnumerableT, Guid) Method
Shuffles an enumerable
source (randomizes its elements) using the provided
seed with a new
FastRandom instance.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static IEnumerable<T> Shuffle<T>(
this IEnumerable<T> source,
Guid seed
)
<ExtensionAttribute>
Public Shared Function Shuffle(Of T) (
source As IEnumerable(Of T),
seed As Guid
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Shuffle(
IEnumerable<T>^ source,
Guid seed
)
[<ExtensionAttribute>]
static member Shuffle :
source : IEnumerable<'T> *
seed : Guid -> IEnumerable<'T>
- source IEnumerableT
- The IEnumerableT to shuffle its elements.
- seed Guid
- A non-Empty seed to use for the shuffling.
- T
- The type of the elements of source.
IEnumerableTAn
IEnumerableT that can enumerate the items of
source in a randomized order.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Subsequent enumerations of the returned collection shuffles the order of the items again an again.
The enumerator of the returned collection does not support the
IEnumerator.Reset method.