Users Pricing

forum

home / developersection / forums / how to work with nested arraylists in vb

How to work with Nested ArrayLists in VB

Pravesh Singh 2259 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!



Student


1 Answers