using System.Collections.Generic;
using System.Collections;
public static void Main()
var array = new int[, ]{{1, 2}, {3, 4}, {5, 6}, {7, 8}};
Console.WriteLine(array[0, 1]);
public static IEnumerable<T> SliceRow<T>(this T[, ] array, int row)
for (var i = array.GetLowerBound(1); i <= array.GetUpperBound(1); i++)
yield return array[row, i];
public static IEnumerable<T> SliceColumn<T>(this T[, ] array, int column)
for (var i = array.GetLowerBound(0); i <= array.GetUpperBound(0); i++)
yield return array[i, column];