2D array?

Hi,
I am retrieving data from a mysql database via php and displaying it like this:

for($i = 0; $i < $num_results; $i++)
    {
         @$row = mysql_fetch_array($result);
         echo @$row['tower'] . "\r";
         echo @$row['grid'] . "\n";
    }

I then need to split this data so that it can be used, I thought about using a 2D array but couldnt figure out how to use it so I did it this way:

string[] lines = Regex.Split(retrieve.text, "\n");

			foreach (string line in lines)
			{
	    		string[] datas = Regex.Split(line, "\r");
				
				Debug.Log("Tower : " + datas[0]);
				Debug.Log("Grid : " + datas[1]);
                       }

this way works but it produces the following error:

IndexOutOfRangeException: Array index is out of range.

I think it is because the last part of the array is empty, any ideas how I can solve this or implement my original idea of a 2D array?

Thanks

In C# a 2D array can be used like this:

String[ , ] array = new String[10,10];

Then you do look ups like array[4,5] = “this is a string”;

However it states that your array is out of index. Where do you set it?

I set it here:

    string[] lines = Regex.Split(retrieve.text, "\n");
     
                foreach (string line in lines)
                {
                    string[] datas = Regex.Split(line, "\r");
                   
                    Debug.Log("Tower : " + datas[0]);
                    Debug.Log("Grid : " + datas[1]);
                           }

it is the datas string[ ] array