Home Cooker Classes Others Rice CookerGX
Classes  >  writer  >  writer(string,bool,bool)
writer class : writer(string,bool,bool) fitter

Description

To specify the writing mode and the presence or absence of the byte order mark(BOM), and initializes a new instance of the writer type of the specified file name.

Syntax

new writer(string fullPath, bool append, bool bom)

Arguments

ClassNameDescription
stringfullPathThe complete file path.
boolappendA value that indicates the writing mode.
boolbomA value that indicates the presence or absence of the byte order mark(BOM).

Return value

ClassDescription
writerA writer type instance that was initialized by specified value.

Sample code

writer writerInstance = new writer("c:\Users\....\target.txt", true, true);

Notes

It's a wrapper of the System.IO.StreamWriter.StreamWriter(String,Boolean,Encoding).

This fitter creates a instance of Writer type with UTF-8 encoding.

If sets the true to the second argument, the instance of writer type is initialized as append mode. Otherwise, it is initialized as overwrite mode.

If sets the true to the third argument, the byte order mark(BOM) will be writen to the file. Otherwise, the byte order mark(BOM) will not be writen to the file.

Links for reference

Copyright © Rice All rights reserved.