| |
Convert ArrayList to Array |
|
Imports System
Imports System.Collections
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim array_list As New ArrayList
array_list.Add("A")
array_list.Add("B")
array_list.Add("C")
' Array of objects.
Dim obj_array() As Object
obj_array = array_list.ToArray()
' Array of strings.
Dim string_array() As String
string_array = DirectCast(array_list.ToArray(GetType(String)), String())
' Array object of objects.
Dim astring_array As Array
astring_array = array_list.ToArray()
End Sub
End Class
|
|
|
Related examples in the same category |
|