jase
5/1/2018 - 7:05 AM

Using expressions in Interpolated Strings in C#

Demonstrates the use of interpolated strings with expressions in C#.

int x = 3, y = 4;
string message = $"My favorite number is { x + 4 }";

Console.WriteLine(message);

// Output:
// My favorite number is 7.