One of the c# operators i tend to use a lot is the ?: operator which is essentially an alternative syntax to an if else statement. Unfortunately i often forget the order of the statements so am adding this quick post as a note for myself to easily remember 🙂
Essentially:
condition ? first_expression : second_expression;
Is equivalent to:
if (condition) { first_expression; } else { second_expression; }
References:
- MSDN ?: Operator
- Also checkout Other C# Operators