-2

I want to know why this code works correctly in C# (at least with Visual Studio 2015). Where can I found information about string literals starting with $ in C#?

class Program
{
    static void Main(string[] args)
    {
        var name = "José";
        var age = 40;
        Console.WriteLine($"Hello {name}, you have {age} years");
    }
}
joseangelmt
  • 2,018
  • 18
  • 32
  • 3
    [Interpolated strings](https://msdn.microsoft.com/en-us/library/dn961160.aspx). Not sure it warrants an answer... – Jesse Good Feb 13 '16 at 09:50

1 Answers1

2

It's c# 6 Interpolated Strings, you can read more about this here

Mohamed Badr
  • 2,562
  • 2
  • 26
  • 43