top | item 30379752

(no title)

Metasyntactic | 4 years ago

>And the code sample you show differs only in that closing quote isn't indented. You don't explain why and how that change would affect the generated string.

Hi there. This is explained in the spec in a few places. In the examples section it explicitly states:

> To make the text easy to read and allow for indentation that developers like in code, these string literals will naturally remove the indentation specified on the last line when producing the final literal value.

> If the indentation behavior is not desired, it is also trivial to disable like so:

I thought that was clear as the prior explanation says that we remove the indentation from teh last line. And then i show how you can disable it. Specifically, as you noted because the closing quote line is no longer indented. Cheers!

discuss

order

intrasight|4 years ago

I really don't like the idea of using whitespace semantically like this. I don't think it's going to get traction in C#.