 | ListExtensionMethodsShuffle Method |
Shuffle a list randomly.
Namespace: Slash.Collections.ExtensionsAssembly: Slash.Collections (in Slash.Collections.dll) Version: 1.0.6018.40177
Syntaxpublic static void Shuffle(
this IList list,
Random random = null
)
<ExtensionAttribute>
Public Shared Sub Shuffle (
list As IList,
Optional random As Random = Nothing
)
public:
[ExtensionAttribute]
static void Shuffle(
IList^ list,
Random^ random = nullptr
)
[<ExtensionAttribute>]
static member Shuffle :
list : IList *
?random : Random
(* Defaults:
let _random = defaultArg random null
*)
-> unit
Parameters
- list
- Type: System.CollectionsIList
List to shuffle. - random (Optional)
- Type: SystemRandom
Random number generator.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IList. 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