C# Language Expressions

Download C# Language for free

Example

Full expressions can also be used in interpolated strings.

var StrWithMathExpression = $"1 + 2 = {1 + 2}"; // -> "1 + 2 = 3"

string world = "world";
var StrWithFunctionCall = $"Hello, {world.ToUpper()}!"; // -> "Hello, WORLD!"

Live Demo on .NET Fiddle

Format dates in strings