Take a look here. I have answered the question providing all the necessary information and a piece of working code to illustrate the results. However there is another answer providing the same logic with mine but it isn't quite correct and produces wrong results moreover if someone else read it they will get the wrong impression about a well documented function.
In particular the line of code
index = generator.Next(0, List.length - 1)
Is wrong because according to the documentation here the second parameter is exclusive which means that the second parameter will never be returned by the function instead the parameter - 1 will be returned. So in that example, as a result, the last number of the array will never be returned. The correct code should be:
index = generator.Next(0, List.length)
This causes two errors. First the code doesn't produce the desired OP's results and second, as I said above, if someone reads it they will get the wrong impression about how the function works.
Of course I did comment in the wrong answer providing details about what's wrong.
Nevertheless, because of the above reasons I feel that I need to down vote the answer, however I have answered the question as well and I don't want to get misunderstood that I am down voting because of competitive reasons or something like that.
My question is: Is it OK if I down vote it?