C # @line break equivalent functionality in Java

In C #, you can use string literals so you don't have to include the + sign to combine strings on multiple lines. For example:

var fooStr = @"This is a foo string. It will have a corresponding bar sibling string"; 

In Java, the same code will be written as:

 String fooStr = "This is a foo string." + "It will have a corresponding bar sibling string"; 

I know that in Java there is no equivalent to verbatim strings, and you should avoid strings yourself. But is there an equivalent to this specific functionality? Or is there a library that helps achieve this?

+7
java
source share

No one has answered this question yet.

See similar questions:

476
Java multi-line string

or similar:

6170
Is Java pass-by-reference or pass-by-value?
3799
How do I read / convert an InputStream to a string in Java?
3324
How to generate random integers in a specific range in Java?
3073
How to efficiently iterate over each entry on a Java map?
3044
Creating a memory leak using Java
2956
What is the difference between public, secure, batch, and private in Java?
2936
When to use LinkedList over ArrayList in Java?
2853
How to convert String to int in Java?
2583
One line array initialization
1729
How to break out of nested loops in Java?

All Articles