Answers for "c# get 1 dimension of 2d array"

C#
16

c# length 2d array

int rowsOrHeight = ary.GetLength(0);
int colsOrWidth = ary.GetLength(1);
Posted by: Guest on May-18-2020
0

c# max in 2d array row

var max = Enumerable.Range(0, PlayerStats.GetLength(1)).Max(i => PlayerStats[1, i]);
//Enumerable.Range gets a range of sequential numbers from 0 to PlayerStats.GetLength(1),
//which represent the indexes of all the items in the second array of PlayerStats.
Posted by: Guest on September-28-2021

C# Answers by Framework

Browse Popular Code Answers by Language