June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to use a one-dimensional array that allows items to be inserted and removed dynamically and resizes itself automatically.
Use the System.Collections.ArrayList class.
The ArrayList class is quite straightforward. Items are added using the Add method. Items can be removed using the Remove, RemoveRange, or RemoveAt methods. The latter two methods remove items based on their index numbers, while Remove searches the collection for the indicated item and then removes it. Instead of using the GetLength method, as you would with an array, you use the equivalent property Count.
Dim List As New ArrayList() List.Add("blue") List.Add("green") List.Add("yellow") List.Add("red") ' Remove "blue" by index ...Read now
Unlock full access