Visual Basic Randomly Shuffle a List
Here is an example of randomly shuffling an object of type List in Visual Basic.
Module ModuleTest Sub Main() Dim myList As List(Of Integer) = New List(Of Integer)() myList.Add(1) myList.Add(2) myList.Add(3) myList.Add(4) myList.Add(5) myList = myList.OrderBy(Function(a) System.Guid.NewGuid()).ToList() For Each item In myList Console.WriteLine(item) Next Console.ReadLine() End Sub End ModuleIn the example above, we create our object named myList and add 5 elements. Then we randomly shuffle our list with "OrderBy(Function(a) System.Guid.NewGuid())" and print it on the screen.