var name = "World"; var str = $"Hello, {name}!"; //str now contains: "Hello, World!";
Internally this
$"Hello, {name}!"
Will be compiled to something like this:
string.Format("Hello, {0}!", name);