C# Array.Resize

In a perfect world you ought not to use an array but a list. Lists are better designed for being chopped n changed you see. But rather than rewrite everything you can resize an array.

string[] MyArray = {"Fred", "Paul", "Jenny", Alex"};

We now have an array with 4 fields. to make space for Pam we need another space

Array.Resize(ref MyArray, 5);

So it's a bit odd. All of me expects MyArray.Resize but nooooo Microsofty are doing this weird. Not to worry.

Reader's Comments

Post Your Comment Posts/Links Rules



Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below

Admin Ren's Biking Blog