From 398a985fca8159a00229db4de001b41036b1e13f Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 6 May 2025 00:39:01 +0900 Subject: [PATCH] Use single quotes for backslashes in StringConcatToTextBlock.md --- docs/bugpattern/StringConcatToTextBlock.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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