Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/bugpattern/StringConcatToTextBlock.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ String message =

## Trailing newlines

If the string should not contain a trailing newline, use a `\ ` to escape the
If the string should not contain a trailing newline, use a '\' to escape the
final newline in the text block. That is, these two strings are equivalent:

```java
Expand All @@ -46,11 +46,11 @@ String s =

The suggested fixes for this check preserve the exact contents of the original
string, so if the original string doesn't include a trailing newline the fix
will use a `\ ` to escape the last newline.
will use a '\' to escape the last newline.

If the whitespace in the string isn't significant, for example because the
string value will be parsed by a parser that doesn't care about the trailing
newlines, consider removing the final `\ ` to improve the readability of the
newlines, consider removing the final '\' to improve the readability of the
string.

[text blocks]: https://docs.oracle.com/en/java/javase/23/text-blocks/index.html