conditional operator
condition ? a : b: a one-line if/else that produces a value.
The conditional operator c ? a : b evaluates c and then exactly one of a or b; it is right-associative.
Examples
string label = stock > 0 ? "In stock" : "Sold out";
See also