Character Escape Sequences


Character escape sequences allow for a character to be interpreted differently than its literal value. Character escape sequences are defined using the backslash (\) character, followed by the escape sequence code. The following table shows a list of character escape sequences with a description of what they do.

Character Escape Sequence Description
\b Backspace
\f Form feed
\n New line
\r Carriage return
\t Tab
\u{hex} Unicode escape sequence
\\ Backslash character. This is how a backslash can be treated as just an actual backslash character.
\' Single quote. Define a single quote character so it is not treated as a character delimiter.
\" Double quote. Define a double quote character so it is not treated as a string delimiter.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Webworldarticles.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.


This article was sent to us by: Gabriela C. Perez at 12292007

Related Articles

1. ISO Management Elements in Java EE .NET Platforms
In a heterogeneous application and platform environment, IT managers are faced with different and often incompatible management frameworks. IT organizations often partiti...

2. Importing Java Packages
To use a package within a Java application or applet, we need to import it. We do this by means of the import keyword. So, for example, if we wish to include the I/O packag...

3. What is a Java Package
A Java package is a collection of related classes that can be imported into your program to support your software. They also provide namespace management, as wel...

4. Conditional Statements
The ability to choose the path that your program takes, based on any given data, is the key to all functionality in programming. In order to create conditional statemen...

5. Java Methods
Methods are used as the building blocks of your program, performing tasks that can be called again and again and using the same code to perform the task each time. The basi...

6. Variable Scope
The scope of a variable is the area in which a variable belongs, specified by the area in which it is declared. The following example code contains two declared variables, ...

7. Regular Expressions in Java
A regular expression is a code that is used to match a pattern in a given string and is new to Java 1.4. Regular expressions are made up of normal characters and metacharac...

8. Introduction to Object Oriented Programming (OOP)
The transition from a procedural programming (non-OOP) language to an object-oriented programming language is a large step for many programmers. It is true that both method...

9. Operator Precedence in programming languages
Operator precedence deciphers the order in which calculations in an expression occur. Looking at the calculation example 3 + 4 * 6, the answer could be calculated by ad...