Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

select a whole row out of a 2d array C#

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();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: use c#9 
Csharp :: c# resize multidimensional array 
Csharp :: how prevent user remove file linux 
Csharp :: c# clear panel 
Csharp :: modal barrier in flutter 
Csharp :: c# 10 null checl 
Csharp :: c# read excel file columns using epplus 
Csharp :: convert date to days c# 
Csharp :: Save variable unity 
Csharp :: check if multiple variables are null c# 
Csharp :: c# external execute batch 
Csharp :: show datatable c# 
Csharp :: c# return two values 
Csharp :: c# method declaration 
Csharp :: C# Convert xml to datatable 
Csharp :: list c# 
Csharp :: c# square symbol 
Csharp :: math in c# 
Csharp :: link list in c# 
Csharp :: action c# 
Csharp :: string vs string c# 
Csharp :: ExpandoObject Add PropertyName and PropertyValue Dynamically 
Csharp :: remove numericUpDown white space 
Csharp :: C# wpf show hidden window 
Csharp :: pass viewbag selectlistitem to razor 
Csharp :: c# accept any enum 
Csharp :: dictionary plus generic class c# 
Csharp :: Handlebars c# datetime now 
Csharp :: 2d collision handling jump table 
Csharp :: c# logical operators 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =