C#ArrayArray.Resize
Array.Clear

Array.ResizeArray

List.Add

Changes the number of elements of a one-dimensional array.

문법

Array.Resize<T>(ref array, newSize)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

arr
Resize
ref
Console
WriteLine
int[] arr = { 1, 2, 3 };
Array.Resize(ref arr, 5);
Console.WriteLine(arr.Length);   // 5