Back to Intellij Community

TrailingWhitespacesInTextBlock

java/java-impl/resources/inspectionDescriptions/TrailingWhitespacesInTextBlock.html

2025.3-rc-2516 B
Original Source

Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler.

Example (where spaces are indicated with dots):

..String.count.=."""
....one
....two....
....three
....""";

Two quick-fixes are provided. One to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler:

..String.count.=."""
....one
....two...\s
....three
....""";

New in 2021.1