Re:Java Feature Spotlight: Text Blocks
by masklinn on Friday May 01, 2020 @09:49AM
(#23041946)
It seems to be using a somewhat similar concept it calls "incidental white space", in order to limit the embedding of leading whitespace (unlike Python which just stores the entire triple-quoted string as-is), but is more permissive:
Text content can be indented less than the trailing delimiter, which I understand is an error in Swift
Text content can be indented less than the trailing delimiter, which I understand is an error in Swift
The trailing delimiter can also be on the same line as the final content, which suppresses the final (new)line: translates to whereas translates to I believe this requires escaping the newline in Swift instead (nb: according to the JEP this would also work in Java).