This question already has an answer here:
- Randomize a List<T> 18 answers
I need to rearrange my List array, it has a non-determinable number of elements in it.
Can somebody give me example of how i do this, thanks
This question already has an answer here:
I need to rearrange my List array, it has a non-determinable number of elements in it.
Can somebody give me example of how i do this, thanks
Obviously if you want real randomness instead of pseudo-random number generator you could use RNGCryptoServiceProvider instead of Random.
This is an extension method that will shuffle a
List<T>
: