Extra info about raw string literals #40678
Labels
doc-enhancement
Improve the current content [org][type][category]
dotnet-csharp/svc
help wanted
Good for community contributors to help [up-for-grabs]
lang-reference/subsvc
Pri1
High priority, do before Pri2 and Pri3
Type of issue
Missing information
Description
I'm writing the formal spec for this feature for the Ecma C# standard, and came across several scenarios your on-line help doesn't mention.
A. The raw string literal's content must not contain a set of contiguous
"
characters whose length is equal to or greater than the raw string literal delimiter length. For example, the strings"""" """ """"
and""""""" """""" """"" """" """ """""""
are well-formed. However, the strings""" """ """
and""" """" """
are ill-formed.B. In a multiline raw string literal, if whitespace precedes the end delimiter on the same line, the exact number and kind of whitespace characters (e.g., spaces vs. tabs) must exist at the beginning of each content line. Specifically, a space does not match a horizontal tab, and vice versa. When using VS, it appears that the editor replaces tabs with spaces, making the leading whitespace the same, but when I used the command-line compiler, csc, on a source file containing leading tabs on some lines and spaces on others, I got an error telling me the leading whitespace did not match.
[Enter feedback here]
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/tokens/raw-string.md
Document Version Independent Id
5737c986-9b06-9444-f7bc-893607d390d7
Article author
@BillWagner
Metadata
The text was updated successfully, but these errors were encountered: