Posted By:
David_Thornton
Posted On:
Wednesday, March 3, 2004 05:04 PM
Java escape sequences and the special characters they represent;
Backspace
Horizontal tab
v Vertical tab
New line
Backspace
f FormFeed
Carriage return
" Double quote
\' Single quote
\ Backslash
For example;
File newFile = new File("C:\myfolder\myfile.txt");
FileOutputStream newFileOutputStream = new java.io.FileOutputStream(newFile);
java.io.PrintStream newPrintStream = new java.io.PrintStream(newFileOutputStream);
newPrintStream.flush();
newPrintStream.println("This will print a line of text followed by carriage return line feed
");
newPrintStream.println("so this text will be on a new line when viewed in Notepad
");
newPrintStream.println("and this text will be
split over two lines
");
newPrintStream.flush();
newPrintStream.close();