Why can't I use the dollar sign $
in Console.WriteLine()
?
I know that I use it for using the C# code in {}
but it doesn't work and I don't know why? My code is:
Console.WriteLine($"Name is : {}");
but Visual Studio gives me some error
Error 1 Unexpected character '$
Error 2 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
I use Visual Studio 2013, I have this problem in this version but in version 2019 I don't have this problem. How can I fix this problem?