Given a string, how can I generate a .txt file containing such a string?
Use File.WriteAllText
File.WriteAllText(filePath, StringToWrite)