Escape Characters




Escape Characters can be inserted into a String of characters to control output.

\n  when printed, this moves the cursor to the start of the next line
\\  when printed, this prints a single back slash
\'  when printed, this prints a single quote
\"  when printed, this prints a double quote
\t  when printed, this moves the cursor to the next tab position
\b  when printed, this moves the cursor back one position


Examples:
  
       
out.println("new line - abc\nabc"); // prints as shown below   
new line - abc
abc

out.println();                                           
out.println("tab - abc\tabc"); // prints   tab - abc      abc
out.println();
out.println("quote  - abc\'abc"); // prints   quote  - abc'abc
out.println();
out.println("quote  - abc'abc"); // prints   quote  - abc'abc
out.println();
out.println("double quote  - abc\"abc"); // prints   double quote  - abc"abc
out.println(); 	
out.println("backslash  - abc\\abc"); // prints   backslash  - abc\abc