> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Ternary-Operator

Der Ternary-Operator ist die Kurzform eines [`if`-Statements](/dotnet/c/kontrollstrukturen/if-statements). Wir können mit ihm auch direkt Werte einer Variable zuweisen.

```csharp theme={null}
variable = (condition) ? expressionTrue : expressionFalse;
```
