Horje
C# get column of 2d array Code Example
C# get column of 2d array
public class CustomArray<T>
{
    public T[] GetColumn(T[,] matrix, int columnNumber)
    {
        return Enumerable.Range(0, matrix.GetLength(0))
                .Select(x => matrix[x, columnNumber])
                .ToArray();
    }

    public T[] GetRow(T[,] matrix, int rowNumber)
    {
        return Enumerable.Range(0, matrix.GetLength(1))
                .Select(x => matrix[rowNumber, x])
                .ToArray();
    }
}




Csharp

Related
c# asp.net hover tooltip Code Example c# asp.net hover tooltip Code Example
how to minimum text length in textbox in c# Code Example how to minimum text length in textbox in c# Code Example
C# random.Next error Code Example C# random.Next error Code Example
visual studio console writeline shortcut Code Example visual studio console writeline shortcut Code Example
get current location latitude and longitude in android Code Example get current location latitude and longitude in android Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10