forum

Home / DeveloperSection / Forums / How to work with Nested ArrayLists in VB

How to work with Nested ArrayLists in VB

Pravesh Singh 1856 11-Jun-2013
Hi Everyone,

I'm try to work with Nested ArrayList in VB.Net. Where i'm wrong? Is there a better way of doing it? 
For some reason my code passes right through the printing code without outputting anything at all. 

My line of code as following

    Dim k As New List(Of String)
    Dim a As New List(Of List(Of String))
       For fc = 1 To 2
          k.add("hi")
          k.add("hey")
          k.add("bye")
          a.add(k)
          k.clear()

 ########Printing Stuff

    Dim i As Integer
    For i = 0 To a.Count - 1
        Dim sstr As String
        For Each sstr In a.Item(i)
            MsgBox(sstr)
        Next
    Next i

Any help would be amazing thank you!



Updated on 12-Jun-2013

Can you answer this question?


Answer

1 Answers

Liked By