So let's move on to the follow up question. If you replace concatenated
strings -- which can have exactly the right amount of indentation:
String s =
"public class Foo { \n" +
" void m() { }\n" +
"}";
with multi-line strings:
String s = """
public class Foo {
void m() { }
}
""";
you've gained one thing (dropping the concat and escapes), but have
inherited a bunch of additional incidental leading whitespace. And
we've talked about two paths for that, the implicit one (where we
auto-align, in the absence of reasons not to), and the explicit one:
String s = """
public class Foo {
void m() { }
}
""".align();
What can your data tell us about how often you care about incidental
whitespace, and how often you'd be saying ".align()"?
On 4/16/2019 4:50 PM, Liam Miller-Cushon wrote:
On Fri, Apr 12, 2019 at 8:39 AM Jim Laskey <james.las...@oracle.com
<mailto:james.las...@oracle.com>> wrote:
Do you have numbers from your RSL survey for, of all string
expressions that are candidates for translation to a multi-line
string literal, what percentage contain no escapes other than
quotes and newline?
Based on our data roughly 1 in 85 candidates for multi-line string
literals contain non-trivial escapes.