C
C#2y ago
krakenblud

❔ 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
Angius
Angius2y ago
File.WriteAllText() File.AppendText() if you want to append to a file
Angius
Angius2y ago
File.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.
Angius
Angius2y ago
Gives you a StreamWriter you can write to
Accord
Accord2y ago
Was 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.
Want results from more Discord servers?
Add your server