title: Splitting strings and placing it into respective columns in datagridview VB.NET
body: <p>I have a List(Of String), I want to display it on my Datagridview wherein this Datagridview's column headers have been set. I want to split the one-line string from the list to the columns in the Datagridview. Here is the example of what I want to be displayed:</p>
  
  <p>This is the strings on the list:</p>
  
  <pre><code>String 1|String 2|String 3
  String a|String b|String c
  </code></pre>
  
  <p>And here is what I want it to look like on the Datagridview:</p>
  
  <pre><code>Column1   Column2   Column3
  String 1  String 2  String 3
  String a  String b  String c
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>For Each mail In emailList
  
      Dim rowStringCollection As String() = mail.Split(New String() {"|"c}, StringSplitOptions.RemoveEmptyEntries)
  
      Dim table As New DataTable()
  
      For Each rowString As String In rowStringCollection
          Dim rowData As String() = rowString.Split(New Char() {"|"c}, StringSplitOptions.RemoveEmptyEntries)
  
          Dim row As DataRow = table.NewRow()
          'Insert the strings into the table
  
      Next
  
      dgvMails.DataSource = table
  Next
  </code></pre>