Shuffle objects in object array randomly in C#


I’m new to Unity. I’m developing a card game and could use a little help shuffling the deck without looping through the array(s) more times than necessary.

(using C#) I have this object array populated with my “Card” prefab objects:

int totalCards =  numberOfDecks * numberOfCardsPerDeck;
object[] aShoe = new object[totalCards];

Assuming aShoe is populated with objects, how can I return aShoe (randomly) shuffled (plz)?

aShuffled = ???
object[] aShoe = aShuffled;


Note: Any random will do and thanx in advance.

The “Inside-Out” algorithm listed here should work nicely: Fisher–Yates shuffle - Wikipedia

Alternatively, for a pre-coded C# method, try this (it’s a bit less efficient though): C# Shuffle Array - Dot Net Perls