2021.2

Table Of Contents
while ((line = fileIn.readLine())!=null){
fileOut.write(line.replace((subject),""));
fileOut.newLine();
}
fileIn.close();
fileOut.close();
deleteFile(data.filename);
tmp.move(data.filename);
tmp.close();
TextWriter
The TextWriter object, returned by the openTextWriter() function, allows to open a text file, write
to it and close it.
Methods
The following table describes the methods of the TextWriter object.
Method Description
close() Close the stream.
newLine() Creates a new line in the file.
open(filename) Creates a new writer on a file to write at the beginning
of the file.
Parameters:
l filename: the path of the file to open
open(inFilename, inEncoding,
append)
Creates a new writer on a file.
Parameters:
l inFileName: the path of the file
l inEncoding: the encoding to be used when writing
to the file
l append: boolean; true if the data will be written at
the end of the file
Page 445