Answers for "a conditional expression cannot be used directly in a string interpolation"

C#
1

A conditional expression cannot be used directly in a string interpolation because the ':' ends the interpolation. Parenthesize the conditional expression.

var result = $"Descending {(isDescending ? "yes" : "no")}";
Posted by: Guest on January-28-2021

Code answers related to "a conditional expression cannot be used directly in a string interpolation"

C# Answers by Framework

Browse Popular Code Answers by Language