WriteAllText()

File::WriteAllText(const String&, const String&, const EncodingPtr&) method

Creates a new text file or overwrites the existing one and writes the content of the specified string to it using the specified encoding.

static void System::IO::File::WriteAllText(const String &path, const String &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked())

Arguments

ParameterTypeDescription
pathconst String&The file to create or overwrite
contentsconst String&A string array
encodingconst EncodingPtr&The character encoding to use

See Also