diff --git a/docs/bugpattern/StringConcatToTextBlock.md b/docs/bugpattern/StringConcatToTextBlock.md index 562b3b738b9..78d04153dfc 100644 --- a/docs/bugpattern/StringConcatToTextBlock.md +++ b/docs/bugpattern/StringConcatToTextBlock.md @@ -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 @@ -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