❔ how to write strings to text file
Everything i tried didnt work, checked stack overflow etc none of that worked either, I'm trying to use a foreach loop to take a line of text and write it to a text file that was already created earlier in the program and then repeat
4 Replies
File.WriteAllText()
File.AppendText()
if you want to append to a fileFile.AppendText(String) Method (System.IO)
Creates a StreamWriter that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist.
Gives you a
StreamWriter
you can write toWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.