Skip to content

Commit

Permalink
Put demonstrative condition into ternary expression
Browse files Browse the repository at this point in the history
It should be made clear that the part before the ternary operator is
indeed a condition, most often created as some comparison expression.
  • Loading branch information
Guntbert Reiter committed Oct 4, 2015
1 parent 38b9bf7 commit b198404
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions de-de/csharp-de.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
[C# Coding Conventions](http://msdn.microsoft.com/de-de/library/vstudio/ff926074.aspx)
3 changes: 2 additions & 1 deletion fr-fr/csharp-fr.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ sur une nouvelle ligne! ""Wow!"", quel style";
// Opérateur ternaire
// Un simple if/else peut s'écrire :
// <condition> ? <valeur si true> : <valeur si false>
string isTrue = (true) ? "True" : "False";
int toCompare = 17;
string isTrue = toCompare == 17 ? "True" : "False";

// Boucle while
int fooWhile = 0;
Expand Down
3 changes: 2 additions & 1 deletion tr-tr/csharp-tr.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ on a new line! ""Wow!"", the masses cried";
// Üçlü operatörler
// Basit bir if/else ifadesi şöyle yazılabilir
// <koşul> ? <true> : <false>
string isTrue = (true) ? "True" : "False";
int toCompare = 17;
string isTrue = toCompare == 17 ? "True" : "False";

// While döngüsü
int fooWhile = 0;
Expand Down
3 changes: 2 additions & 1 deletion zh-cn/csharp-cn.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ on a new line! ""Wow!"", the masses cried";
// 三元表达式
// 简单的 if/else 语句可以写成:
// <条件> ? <真> : <假>
string isTrue = (true) ? "True" : "False";
int toCompare = 17;
string isTrue = toCompare == 17 ? "True" : "False";

// While 循环
int fooWhile = 0;
Expand Down

0 comments on commit b198404

Please sign in to comment.