rspec/rules/S2479/java/rule.adoc
2020-06-30 17:16:12 +02:00

22 lines
587 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

include::../description.adoc[]
== Noncompliant Code Example
----
String tabInside = "A B"; // Noncompliant, contains a tabulation
String zeroWidthSpaceInside = "foobar"; // Noncompliant, it contains a U+200B character inside
char tab = ' ';
----
== Compliant Solution
----
String tabInside = "A\tB"; // Compliant, uses escaped value
String zeroWidthSpaceInside = "foo\u200Bbar"; // Compliant, uses escaped value
char tab = '\t';
----
== Exceptions
Text Blocks string literals (java 13 three double-quote marks) can contain tabulations to allow indentation using tabulations.