dotnetnoob wrote:
i have a arraylist that store String() array
the string array hold value 1 2 4
i want to access the string array that is inside the arraylist one arraylist
item at the time
Dim MyStringArray As String() = DirectCast(MyArrayList(2), String())
Dim sValue As String = MyStringArray(3)
This line gets the fourth string (0 based) from the string array that
is index 3 of the array list. Since ArrayList only returns Object, you
must cast that object to an array of strings.
If you are using VS2005 or .Net 2.0, consider using the generic list
class:
Dim MyArrays As List(Of String())
'Code to populate the list here
Dim MyStringArray As String() = MyArrays(2)
Dim sValue As String = MyStringArray(3)