Link to home
Create AccountLog in
Avatar of sebastiz
sebastiz

asked on

Create arraylists dynamically based on loop

I have a textbox with some text in it. I have a loop that retrieves bits of the text based on a regular expression and stores it in a listbox.
I then have a second loop which takes each value in this listbox and retrieves bits of the text in the textbox with a regular expression based on each value from the first listbox, and stores all of it in another listbox.
I would like to create an array list for each value in the first listbox which stores the retrieved bit of text for that value from the second loop.
I guess the question is about how to create a number of new arraylists programmatically based on how many items are in a listbox...... (in vb.net)

Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

ArrayLists are resizable, so you don't need to know how many items it will hold.

http://msdn.microsoft.com/en-us/library/system.collections.arraylist.aspx

Wayne
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of sebastiz
sebastiz

ASKER

Great. How do I then reference the arraylist within the arraylist. Lets say I then want to loop through the second arrayllist in the parent arraylist?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Brilliant. Many thanks