开发者社区 问答 正文

如何在C#中获取多维数组的行/列的长度?

如何在C#中获取多维数组的行或列的长度?

例如:

int[,] matrix = new int[2,3];

matrix.rowLength = 2; matrix.colLength = 3; 问题来源于stack overflow

展开
收起
保持可爱mmm 2020-02-09 13:38:04 584 分享 版权
1 条回答
写回答
取消 提交回答
  • matrix.GetLength(0) -> Gets the first dimension size

    matrix.GetLength(1) -> Gets the second dimension size

    2020-02-09 13:38:18
    赞同 展开评论
问答分类:
C#
问答地址: