I'm trying to shuffle an array's order

So i’m trying to make a card game and i want to shuffle the deck but i have no idea how to get stuff from one array to an other so i really hope someone can help me. this is the script i want to use to shuffle the cards.
using UnityEngine;
using System.Collections;

public class DeckScript : MonoBehaviour {
    //the deck 60 cards
    [SerializeField]
    GameObject[] decklist;

    //shuffle arrays 20 cards each 
    [SerializeField]
    GameObject[] shuffleArray1;
    [SerializeField]
    GameObject[] shuffleArray2;
    [SerializeField]
    GameObject[] shuffleArray3;

    private int arraystate = 1;
	// Use this for initialization
	void Start () {
        Shuffle();
	}
	
	// Update is called once per frame
	void Update () {
	
	}
    void Shuffle()
    {
        int randomnumber = Random.Range(4, 20);
        for (int a = 0; a < randomnumber; a++)
        {
            for (int i = 0; i < decklist.Length; i++)
            {
                switch (arraystate)
                {
                    case 1:
                        //take card from decklist put in shufflearray1
                        Debug.Log("shuffleArray1");
                        arraystate += 1;
                        break;
                    case 2:
                        //take card from decklist put in shufflearray2
                        Debug.Log("shuffleArray2");
                        arraystate += 1;
                        break;
                    case 3:
                        //take card from decklist put in shufflearray3
                        Debug.Log("shuffleArray3");
                        arraystate += 1;
                        break;
                }
                if (arraystate > 3)
                {
                    arraystate = 1;
                }
            }
            //dump all shufflearrays in deckllist in random order
        }
    }
}

This should shuffle the gameObjects in decklist without the need of a 2nd array.

(decklist should be filled first in the inspector or from another script):

using UnityEngine;
using System.Collections;

public class DeckShuffle : MonoBehaviour {
	public GameObject[] decklist;
	private GameObject tempGO;
	
	void Start () {
		Shuffle();
	}
	
	public void Shuffle() {
		for (int i = 0; i < decklist.Length; i++) {
			int rnd = Random.Range(0, decklist.Length);
			tempGO = decklist[rnd];
			decklist[rnd] = decklist*;*

_ decklist = tempGO;_
* }*
* }*
}

The accepted answer from antx isn’t bad but it will produce weighted results. I know because it’s the same solution I came up with when considering the same problem and I was corrected by a more experienced programmer at work.

Two small changes need to be made to fix the imbalance.

  1. Stop the loop before the last entry.
  2. Randomize from i to Length rather than 0 to Length.

The modified function should look like this:

public void Shuffle() 
{
         for (int i = 0; i < decklist.Length - 1; i++) 
         {
             int rnd = Random.Range(i, decklist.Length);
             tempGO = decklist[rnd];
             decklist[rnd] = decklist*;*

decklist = tempGO;
}
}

The question has been answered quite elegantly here . Basically, just make an extension method for IEnumerables and you are good to go. Just call decklist.Shuffle() and done.