22 lines
610 B
Plaintext
22 lines
610 B
Plaintext
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
|
||
Console.WriteLine(zeroWidthSpaceInside); // Prints "foo?bar"
|
||
----
|
||
|
||
== Compliant Solution
|
||
|
||
----
|
||
string tabInside = "A\tB"; // Compliant, uses escaped value
|
||
string zeroWidthSpaceInside = "foo\u200Bbar"; // Compliant, uses escaped value
|
||
Console.WriteLine(zeroWidthSpaceInside); // Prints "foo?bar"
|
||
----
|
||
|
||
== Exceptions
|
||
|
||
Verbatim string literals have no escape character mechanism.
|