The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re:Escape Character

Posted by Matt Gerrans on October 25, 2001 at 10:49 PM

> Use the plus(+) sign instead of the backslash
> > String strTest = "First Line \
> > sdfsdfsdf";

Well, you'll also need to add a couple more quote marks, like so:

String strTest = "'Twas brillig " +
" and the slithy toves...";

What you are really doing is not a line-continuation (which doesn't exist in Java), but concatenating two strings to make a longer one.

- mfg


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us