rbwhitaker / CSharpPlayersGuideEarlyAccess

A place to track issues with the C# Player's Guide for patches and future editions
19 stars 0 forks source link

Newlines in interpolated strings #651

Closed rbwhitaker closed 1 year ago

rbwhitaker commented 2 years ago

You can now put newline characters between the { and } and have it work out.

I don't know that the book needs to specifically touch on this. I don't think I mentioned any limitations in this regard, and I'd generally advise caution about making interpolated strings too complicated, which this only serves to make easier to do.

rbwhitaker commented 1 year ago

After reviewing the content of the book, nothing needs to be revised to account for this feature. It never prohibited it, and the working is vague enough that I think if you try it, you'll now see that it works. The book still discourages complex expressions baked into your string interpolations, which I think is correct.