HomeForumResearchGuide
Sign in to reply to forum posts.
Multi-line strings

Hello,

I have some very long strings that I'm using, including multiple variables, and would prefer to avoid having it all on one line like:

out.println("my very long string with $i some variables $included")

is there an easy way to split this over multiple lines for readability?

Hi Noah,

I think you're asking how to do this in your source code, rather than produce a multi-line output. If so you can use array concatenation:

out.println( new char[]("my very long string",
                           "with $i some vairables",
                           "included"
                            ) )

Hope that helps!

Barry

That's great thanks!