Deriving length of a given dimension in a 2D array

‘map’ in this case is a 2D array of strings, all containing ‘#’ (effectively a blank map to be used in procedural generaion, say, in a roguelike).

function convertMapToGui (map:String[,]) {
var mapGuiString: String;

for (var x = 0; x < map.Length; x++) {
	for (var y = 0; y < 6; y++) { //Figure out how to get both dims later. '6' ain't gonna cut it. :p
		mapGuiString += (map[x,y].ToString);
	mapGuiString += ('

return mapGuiString;

What I’m trying for here is a function that will turn that array into a single string I can display by sticking in a GUI box, wich each row being a line of it.

The array is 10x40 and map.Length returns ‘400’, telling me its combining both dimensions and returning that.

Question is, how do I get the length for each dimension on its own?

(Yes, I know there’s WAY more wrong here, but I’m posting one question at a time.)

From a single google search :stuck_out_tongue: