No way to isolate a row from a proper 2D array. If it were a jagged array, then the solution would be obvious.
Therefore, if working with rows of the array is important operation to you, then you might consider turning it into the jagged array.
Otherwise, if this operation is not of fundamental importance, then a loop is the least disturbing way to go.
You may choose to add a simple extension method for this purpose, and in that way put entire problem under the rug:
public static class ArrayExtensions
{
public static IEnumerable<T> GetRow<T>(this T[,] array, int rowIndex)
{
int columnsCount = array.GetLength(1);
for (int colIndex = 0; colIndex < columnsCount; colIndex++)
yield return array[rowIndex, colIndex];
}
}
This would give you the option to address only one row:
IEnumerable<int> row = array.GetRow(1);
For example, you could print one row from the matrix in one line of code:
Console.WriteLine(string.Join(", ", array.GetRow(1).ToArray()));