For those of us who came from a VB background, we know how great the immediate if is (iif).

To do this in C#, it’s not so straightforward it seems, at least at first, but it’s just as easy and useful. Here’s how it’s the framework is done in C#:

yourBool ? "true" : "false";

That’s all there is to it!