Enhancements to interpolated strings
Almost every application will have some sort of text processing. In .NET, there are many ways available for string manipulation, such as the string primitive type, StringBuilder, ToString overrides on types, String concatenation, and string.Format, which provides functionality to build a string from a composite format string. String.Format takes a format string and format items as input and generates the formatted string as depicted in the following code:
string message = string.Format("{0}, {1}!", Greeting, Message);
In the previous code, the positions {0} and {1} in the format string will be filled with the Greeting and Message format items respectively passed in as arguments. To make it more friendly and readable, C# 6 added a new language syntax called interpolated strings, as shown in the following code snippet:
string Greeting = "Hello";
string Language = "C#";
int version = 10;
string message...