Saving lists to txt file
Framework 4: no need to use StreamWriter:
System.IO.File.WriteAllLines("SavedLists.txt", Lists.verbList);
Assuming your Generic List is of type String:
TextWriter tw = new StreamWriter("SavedList.txt");
foreach (String s in Lists.verbList)
tw.WriteLine(s);
tw.Close();
Alternatively, with the using keyword:
using(TextWriter tw = new StreamWriter("SavedList.txt"))
{
foreach (String s in Lists.verbList)
tw.WriteLine(s);
}
@Jon's answer is great and will get you where you need to go. So why is your code printing out what it is. The answer: You're not writing out the contents of your list, but the String representation of your list itself, by an implicit call to Lists.verbList.ToString(). Object.ToString() defines the default behavior you're seeing here.