LANGUAGE

String interpolation

Evaluates the embedded expression and includes its formatted representation in the result.

Formal Syntax & Structure

csharp syntaxcsharp
$"Text {expression}"

Working Example

Example Snippetcsharp
int count = 7; string label = $"Count: {count}";
C# & .NET Reference