Hi folks!
i want to convert a multidimensional array "string[][] theArray" into an ArrayList and then read out one of the partial arrays "string[] theStringArray".
the problem is that i get the error that i want to convert an object into a string[].
my code is
void myFunction(int cnt)
{
ArrayList tmpList = ArrayToArrayList(theArray);
int counter = cnt/2;
while (counter-- >= 1)
{
int lengthOfList = tmpList.Count;
int rndM = Random.Range(0, lengthOfList - 1);
string[] tmpPair = tmpList[rndM]; // <--- HERE I GET THE ERROR !!!
tmpList.RemoveAt(rndM);
//...
}
}
ArrayList ArrayToArrayList(string[][] theArray)
{
ArrayList theList = new ArrayList();
for (int i = 0; i < theArray.Length; i++){
string[] tmp = theArray*;*
*theList.Add(tmp);*
*}*
*return theList;*
*}*
*```*
*<p>so whats my problem (besides that I am new to c#)?*
*thanx!</p>*