In .NET, you cannot change the size of an array, its rank and so on — you can only modify any element of the array.
If you want to add/remove anything, use
collections instead, for example, the simplest one,
System.Collections.Generic.List<>
. Note that the instance of
List
can be converted to array when you populate it.
Don't be confused with the method
System.Array.Resize
— despite this name (yet another confusing Microsoft name!), it does not resize anything; instead, it creates a brand new array, which is too expensive to take seriously, better use collection, in nearly all cases. The fact that the new array instance is created is mentioned in the "Remark" section of the MSDN help page,
Array.Resize(T) Method (T[], Int32) (System)[
^].
Arrays are only good when you know the rank and the length in each dimension in advance, when you create an instance of an array.
—SA