title: How to write an ArrayList to a text file?
body: <p>I have an ArrayList of strings and a text file called actors. I need to write all the elements in the ArrayList to a .txt file. Here is my code so far.</p>
  
  <pre><code>void WriteArrayList()
      {                        
          foreach (object actor in ActorArrayList)
          {
              File.WriteAllLines("C:\\actors.txt", actor); 
          }
      }
  </code></pre>