Writing the contents of a string to a text file

I should have assumed this existed, based on Ed Poore’s comment on this post, but here’s the actual command:


There are multiple overloads for it, but the most basic one is: File.WriteAllText(filePath,contentString).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.