title: converting a generic list to string array
body: <p>I have a generic List(Of Customer). The customer class has a name, address, and phone number properties. I also have a property of another class that accepts a customer name array. I am able to do this by doing the following:</p>
  
  <pre><code>
  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
  </code></pre>
  
  <p>Then to set it:</p>
  
  <pre><code>
  'CustomerNames is a String()
  Class.CustomerNames = names
  </code></pre>
  
  <p>Is there a better way to convert this to a string array? Any help is appreciated. Thanks.</p>