From b1984042c845a73333972715e88a3d7a2e8cfdd7 Mon Sep 17 00:00:00 2001 From: Guntbert Reiter Date: Sun, 4 Oct 2015 16:44:24 +0200 Subject: 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. --- de-de/csharp-de.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'de-de/csharp-de.html.markdown') 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: // ? : - 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) -- cgit v1.2.3