Click or drag to resize

EnumerableExtensionsShuffleT Method

Produces a new list with the same items as the original list but in random order

Namespace:  TestHelperExtensions
Assembly:  CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntax
public static IEnumerable<T> Shuffle<T>(
	this IEnumerable<T> list
)

Parameters

list
Type: System.Collections.GenericIEnumerableT
The list to be shuffled

Type Parameters

T
The type of the elements of the list

Return Value

Type: IEnumerableT
An IEnumerable containing elements of the same type as the original IEnumerable but in a random order

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