LANGUAGE
Conditional operator ?:
Selects one of two result expressions from a Boolean condition. The unselected expression is not evaluated.
Formal Syntax & Structure
csharp syntaxcsharp
condition ? whenTrue : whenFalseWorking Example
Example Snippetcsharp
string message = 3 > 0 ? "Ready" : "Empty";