Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# resize multidimensional array

void ResizeArray<T>(ref T[,] original, int newCoNum, int newRoNum)
    {
        var newArray = new T[newCoNum,newRoNum];
        int columnCount = original.GetLength(1);
        int columnCount2 = newRoNum;
        int columns = original.GetUpperBound(0);
        for (int co = 0; co <= columns; co++)
            Array.Copy(original, co * columnCount, newArray, co * columnCount2, columnCount);
        original = newArray;
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: boxing and unboxing in c# 
Csharp :: c# webbrowser write html to text file 
Csharp :: c# clear panel 
Csharp :: c# check if string contains character multiple times 
Csharp :: c# reflection get property value array 
Csharp :: web.config customerrors not working 
Csharp :: usermanager find based on role 
Csharp :: .net core login redirect loop 
Csharp :: base c# 
Csharp :: foreach for IEnumerable 
Csharp :: how to get properties from json in c# 
Csharp :: count number of specific characters in string c# 
Csharp :: c# convert list to string and back 
Csharp :: How to execute script in C# 
Csharp :: datetimeoffset to datetime 
Csharp :: generic interface c# 
Csharp :: c# code examples 
Csharp :: delete all fields that start with mongo 
Csharp :: c# collection of generic classes 
Csharp :: c# sort array by value 
Csharp :: How to find column name with column index in DataGridView 
Csharp :: why does everything reset when switching scene unity 
Csharp :: c# bool? to bool 
Csharp :: txt.att.net not working 2021 
Csharp :: List of border roleplays roblox 
Csharp :: mesh decimate pyvista 
Csharp :: how to combine constructors in c# 
Csharp :: c# UserControl make background transparent 
Csharp :: mysql executeScalar only if successful 
Csharp :: C# return dictionary string/integer from comparison of List and Array 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =