Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Java Language
Expertise: Beginner
Aug 8, 2000



Application Security Testing: An Integral Part of DevOps

Escaped Characters

When defining a string, is there a way to include a carriage return in the text?

Yes. A carriage return is represented by the special escaped character \r. However, make sure that if you really want a line separator, and not a carriage return, that you query the line.separator property using System.getProperty(). Java supports the following escaped characters:

  • \b backslash
  • \t horizontal tab
  • \n linefeed
  • \f form feed
  • \r carriage return
  • \" double quote
  • \' single quote
  • \\ backslash
Octal values and Unicode escape values are also supported.
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date