C# Language String Interpolation Simple Usage

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

var name = "World";
var str = $"Hello, {name}!";
//str now contains: "Hello, World!";

Behind the scenes

Internally this

$"Hello, {name}!" 

Will be compiled to something like this:

string.Format("Hello, {0}!", name);


Got any C# Language Question?