16 November

C# 11 – String interpolated new line


min. read

Reading Time: < 1 minute
C# 11
C# 11

Let’s list all the features that C# 11 brings to the table. Let’s discuss them all one by one, with their use cases, and see how they can come in handy. At the bottom of each article, you can find a link to all 14 new C# features!

String interpolated new line

In the previous releases of C#, we had problems when we tried to create a line break in the middle of a verbatim block.

var variable = "World";
var verbatim = $"Hello {variable.ToLower()}"; // Ok
var error = $"Hello {variable.  // <- error before C# 11

In new C# 11, you can now make line breaks in the middle of the variables. This will be useful for use cases when the line is too long and you are looking at the place to break it!

This is still one line when you print it!

Still in C# 10, how to do it then?

Before you had only the following options:

var break1 = "Hello " +
// This one might be inconvinient as it might print in 2 separate lines.
var break2 = [email protected]"Hello 

I like this change, it’s convenient!

Further reading at dotnet GitHub page.

Current article:
String interpolated new line


Tomasz Juszczak


Technical Lead

Tomasz Juszczak

About prog

Founded in 2016 in Warsaw, Poland. Prographers mission is to help the world put the sofware to work in new ways, through the delivery of custom tailored 3D and web applications to match the needs of the customers.


C# 11 – UTF-8 string literals


min. read

C# 11 – Generic Math Support


min. read

Let's talk


I agree that my data in this form will be sent to [email protected] and will be read by human beings. We will answer you as soon as possible. If you sent this form by mistake or want to remove your data, you can let us know by sending an email to [email protected] We will never send you any spam or share your data with third parties.