How can I take an existing arraylist of strings, and depending on the content of said strings, group them into their own arraylist?
The strings are file names with a naming convention:
The arraylist contains 8 items
What I want to do is put the items having a ItemNumber of 101 into one array and have items with a ItemNumber of 102 in its own, separate array.
I am able to use the split() function to get the individual parts of the filename. I have attached the code that I am using for that.
Private Sub CreateDescription_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim FileNames As ArrayList = SelectionForm.prpImageFilenames
For Each PictureFile As FileInfo In FileNames
Dim AllFiles As Object = Split(PictureFile.Name, "-")
Dim ItemPrefix As String = AllFiles(0)
Dim ItemBagNumber As String = AllFiles(1)
Dim ItemNumber As String = AllFiles(2)
Dim ItemDate As String = AllFiles(3)
Dim ItemPicSequence = AllFiles(4).Remove(1, 4)