IEnumerableExtensionsShuffleT Method |
Shuffles the elements of a sequence.
Namespace: Bio.UtilAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static List<T> Shuffle<T>(
this IEnumerable<T> sequence,
Random random
)
<ExtensionAttribute>
Public Shared Function Shuffle(Of T) (
sequence As IEnumerable(Of T),
random As Random
) As List(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static List<T>^ Shuffle(
IEnumerable<T>^ sequence,
Random^ random
)
[<ExtensionAttribute>]
static member Shuffle :
sequence : IEnumerable<'T> *
random : Random -> List<'T>
Parameters
- sequence
- Type: System.Collections.GenericIEnumerableT
The sequence of elements to shuffle - random
- Type: SystemRandom
a random number instance
Type Parameters
- T
- the type of the elements in the sequence
Return Value
Type:
ListTa list of shuffled items
Usage Note
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).
See Also