Tuesday, November 27, 2007

Copy an ArrayList in VB.NET

Say you have the following two arraylists, A, B

You can't just do A = B to copy A to B. It will just create a
reference to B (so when you modify B, A will be modified as well).

In order to copy it, you need to do the following

A = new ArrayList(B)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.