0

I have this line of code:

var defaultResult = $"Enum_{@this.GetType().Name}_{@this}";

but I get this error:

expected ;

How do I fix this? String.Format?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user979331
  • 11,039
  • 73
  • 223
  • 418

2 Answers2

2

The $ is a feature available in C# 6.0. Make sure you're set to the correct version.

Drew Kennedy
  • 4,118
  • 4
  • 24
  • 34
0

String interpolation is supported onward c# 6.0. read here for more