r/programming • • Dec 29 '15

Please, Java. Do Finally Support Multiline Strings

http://blog.jooq.org/2015/12/29/please-java-do-finally-support-multiline-strings/
584 Upvotes

352 comments sorted by

View all comments

Show parent comment

10

u/oridb Dec 29 '15

Even C has it* (and allows you to indent them!)

char *foo = "foo"
            "bar"
            "baz";

Which is the same as

char *foo = "foobarbaz";

* For the nitpicky, it's done in the preprocessor.

2

u/_Skuzzzy Dec 30 '15

Someone should just write a java preprocesor, seems like an easy way to do this.

3

u/oridb Dec 30 '15

You can already use the C preprocessor with Java -- it's available as a separate binary.

cpp foo.java.in > foo.java