The new String Interpolation and Ternary Operator

A quick tip for the new C# string interpolation. The new string interpolation has made things more simpler and readable. One might be tempted to include ternary operators within string interpolation.

However if you attempt something like following, the compiler would throw an error


The fix is as simple as it can get. Just include a brace within your ternary statement.


That’s it. Brace up for a week with lot of fun and coding.