File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Multiline Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Multiline Strings" Watch "Multiline Strings" New topic
Author

Multiline Strings

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hi all,
I just wanted to know whether is it possible to have a multiline String with the end quote in a saperate line.

String j = "Multiline
String
Like this";
Thank you very much. (with out the concatanation)


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
But you can put new-lines into Strings. Get the platform-dependent new-line String from line.separator. Add this into the String at the desired places.



People do use "\n" for new-line, but that's not strictly portable.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
David Han
Greenhorn

Joined: Nov 27, 2004
Posts: 1
Good!I see. Thanks,Peter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiline Strings