C# language feature:
applies to
benefit
how to use
note
$"<text> {<interpolated-expression> [,<field-width>] [:<format-string>] } <text> ..."
example:
class String_interpolation_Example
{
public void Use_of_String_interpolation()
{
var name = "Jeff";
Console.WriteLine($"Hello, {name}!"); // note $ prefix used to denote embedded inline code.
// old way i.e. composite string formatting
Console.WriteLine("Hello, {0}!", name); // note the argument 'name' is not needed for string interpolation
}
}