I have a general list (Customer). The customer class has a name, address, and phone number. I also have a property of another class that accepts an array of client names. I can do this by following these steps:
Dim names As String() Dim i As Integer = 0 'customer.GetCustomers is a List(of Customer) For Each customer As Customer In customer.GetCustomers() ReDim Preserve names(i) names(i) = customer.Name i += 1 Next
Then install:
'CustomerNames is a String() Class.CustomerNames = names
Is there a better way to convert this to an array of strings? Any help is appreciated. Thanks.
source share