What's New in C# 10: Create Constants Using String Interpolation

added by DotNetKicks
3/15/2022 8:49:50 AM

283 Views

This is part of a series on the new features introduced with C# 10. Prior to C# 10 if you wanted to create a const that was made up from other constants you had to add the string fragments togeter, for example (C# 9): const string SupportedCurrencyCodes = "GPB, USD, AUD"; const string Copyright = "Jason Roberts"; const string TwitterSupportAccount = "@RobertsJason"; const string AboutMessage = "Currency codes supported '" + SupportedCurrencyCodes + "'.


0 comments