diff options
author | Guntbert Reiter <guntbert@gmx.at> | 2015-10-04 16:44:24 +0200 |
---|---|---|
committer | G. Reiter <guntbert@gmx.at> | 2015-10-04 21:56:24 +0200 |
commit | b1984042c845a73333972715e88a3d7a2e8cfdd7 (patch) | |
tree | 29cfa9d0f1de495d82bf209215d5b707ad5b3b77 /de-de | |
parent | 38b9bf7eed7ae3b7f2cf1fc97f01a223f88fce90 (diff) |
Put demonstrative condition into ternary expression
It should be made clear that the part before the ternary operator is
indeed a condition, most often created as some comparison expression.
Diffstat (limited to 'de-de')
-rw-r--r-- | de-de/csharp-de.html.markdown | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/de-de/csharp-de.html.markdown b/de-de/csharp-de.html.markdown index dc77dda0..8ad7d71f 100644 --- a/de-de/csharp-de.html.markdown +++ b/de-de/csharp-de.html.markdown @@ -248,7 +248,8 @@ zur nächsten Zeile, ""Wahnsinn!"", die Massen waren kaum zu bändigen"; // Ternärer Operator
// Anstatt eines einfachen if/else lässt sich auch folgendes schreiben:
// <condition> ? <true> : <false>
- string isTrue = true ? "Ja" : "Nein";
+ int zumVergleich = 17;
+ string isTrue = zumVergleich == 17 ? "Ja" : "Nein";
// while-Schleife
int fooWhile = 0;
@@ -886,4 +887,4 @@ zur nächsten Zeile, ""Wahnsinn!"", die Massen waren kaum zu bändigen"; * [ASP.NET Web Forms Tutorials](http://www.asp.net/web-forms/tutorials)
* [Windows Forms Programming in C#](http://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208)
-[C# Coding Conventions](http://msdn.microsoft.com/de-de/library/vstudio/ff926074.aspx)
\ No newline at end of file +[C# Coding Conventions](http://msdn.microsoft.com/de-de/library/vstudio/ff926074.aspx)
|