Following is a String interpolation example. If apple is equals to apple it returns yes or else no.
var result = $"{("apple" == "apple" ? "yes" : "no")}";
What I need to do is to assign a string
string text= "{(apple == apple ? yes: no)}";
var result = $"{text}";
I expected var result will be yes. As its similar to the above code. However, the result I get is the string text it self.
My question: How can I pass a string similar to "{(apple == apple ? yes: no)}"and get an output like yes or no ?
{(apple == apple ? yes: no)}(May be I should have rephased it as the output of the variable text).FormattableStringbut I haven't personally used it yet.