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
  • 704,970
  • 168
  • 1,303
  • 1,425
user979331
  • 9,373
  • 64
  • 206
  • 383

2 Answers2

2

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

Drew Kennedy
  • 4,076
  • 4
  • 22
  • 34
0

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