Longitud de un arreglo anidado

Published by SyntaxGardener in

Devuelve el número total de elementos que no son arreglos contenidos, en cualquier profundidad, dentro de un arreglo anidado.

Ejemplos

Program.GetLength(new object[] { 1, new object[] { 2, 3 } }) ➞ 3

Program.GetLength(new object[] { 1, new object[] { 2, new object[] { 3, 4 } } }) ➞ 4

Program.GetLength(new object[0]) ➞ 0