Far Away Developer

Sebastien Lachance

Adding an element to an array in C#

Posted by Sebastien Lachance on September 26, 2007

It’s probably the same thing in VB.NET but the example is in C#.

   1: Address[] addresses = customer.AddressList;
   2:
   3: Array.Resize(ref addresses, addresses.Length + 1);
   4:
   5: addresses[addresses.Length - 1] = address;

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>