title: Convert Generic List<string> to byte[ ]
body: <p>Hi i need to convert a generic list to an byte[] but my code doesn't work
  Can anybody give me some hints?</p>
  
  <p>Thanks!</p>
  
  <pre><code>List&lt;string&gt; lines = inputFile.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).ToList();
  
  byte[] output = new byte[lines.Count];
  Encoding enc = Encoding.UTF8;
  int i = 0;
  
  foreach (string item in lines)
  {
     output[i] = enc.GetBytes(item);
     i++;
  }
  </code></pre>