I realize the question is a bit old but for flexability sake, I modfied the method a bit to calculate the array sizes within the method as opposed to having to pass them in:
static object[][] convertToJaggedArray(object[,] multiArray)
{
int firstElement = multiArray.GetLength(0);
int secondElement = multiArray.GetLength(1);
object[][] jaggedArray = new object[firstElement][];
for (int c = 0; c < firstElement; c++)
{
jaggedArray[c] = new object[secondElement];
for (int r = 0; r < secondElement; r++)
{
jaggedArray[c][r] = multiArray[c, r];
}
}
return jaggedArray;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…