Constant Interpolated String
- From C# 10,
const
strings may be initialized using string interpolation
if all the placeholders are themselves constant strings.
- String interpolation can create more readable constant strings in your application.
- The placeholder expressions can't be numeric constants because those constants are converted to strings at run time.
const string Language = "C#";
const string Platform = ".NET";
const string Version = "10.0";
const string FullProductName = $"{Platform} - Language: {Language} Version: {Version}";
Console.WriteLine(FullProductName);