Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# reflection resize array

static void Resize(ref Array array, int newSize) {        
    Type elementType = array.GetType().GetElementType();
    Array newArray = Array.CreateInstance(elementType, newSize);
    Array.Copy(array, newArray, Math.Min(array.Length, newArray.Length));
    array = newArray;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# datetime add 
Csharp :: visual studio console clear 
Csharp :: c# lambda join two tables 
Csharp :: how to see image from website in wpf 
Csharp :: c# convert int to string 
Csharp :: inline creation dictionnary C# 
Csharp :: c# byte 
Csharp :: fade image out unity 
Csharp :: Throw index out of range C# 
Csharp :: c# dictionary add 
Csharp :: clamp vector3 unity 
Csharp :: string list to object array in c# 
Csharp :: raycasting in unity 
Csharp :: c# regex match 
Csharp :: ef core set identity_insert off 
Csharp :: c# list audio devices 
Csharp :: c# turn negative number into positive 
Csharp :: c# nullable string 
Csharp :: unity editor script 
Csharp :: C# default value for datetime parameter 
Csharp :: unity find child by name 
Csharp :: how to play multiple sound at once on c# windows form 
Csharp :: vector2 with switch statement 
Csharp :: c# .net core memory cache 
Csharp :: convert object to httpcontent c# 
Csharp :: trim c# 
Csharp :: contains duplicate 
Csharp :: convert-integer-to-binary-in-c-sharp 
Csharp :: group by ef core 
Csharp :: C# clear form 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =