AppendAllLines()

File::AppendAllLines(const String&, const SharedPtr<Collections::Generic::IEnumerable<String>>&, const EncodingPtr&) method

Appends strings from the specified collection of strings to the specified file using the specified encoding by writing each string in a new line. If the specified file does not exist, it is created. The file is closed after writing all strings.

static void System::IO::File::AppendAllLines(const String &path, const SharedPtr<Collections::Generic::IEnumerable<String>> &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked())

Arguments

ParameterTypeDescription
pathconst String&The path of the file to append the strings to
contentsconst SharedPtr<Collections::Generic::IEnumerable<String>>&The strings to write to the file
encodingconst EncodingPtr&The character encoding to use

See Also