dynamic Arrays

sachmo

Member
Joined
Aug 2, 2007
Messages
14
Programming Experience
Beginner
Hey, I would like to store a series of strings with an unknown limit into an array. The number of items that could be represented in my array are unknown so I don't want to define an array with a set number of items. I would like to just define an array and store items into it as they come as many as there are. Is this possible, if so can I see an example?

TIA
 
They are called collections, create yourself a new List(Of String).
 
Hey, thank you. Is there a difference between Arraylist and List(Of String)?

[EDIT]

Difference Between Arraylist and List(Of String):

Arraylist is a .net 1.0 leftover and is slower than the 2.0 List(Of String) by only a few ms. No real difference.
 
Last edited:
Difference Between Arraylist and List(Of String):

Arraylist is a .net 1.0 leftover and is slower than the 2.0 List(Of String) by only a few ms. No real difference.
Big difference! ArrayList is Object type. List(Of T) is any type you choose it to be, this also means all methods and return types is strongly typed. All the new (Of T) stuff in .Net 2.0 is called generics, List(Of T) is also from System.Collections.Generics namespace.
 
Back
Top