1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-24 15:23:09 +02:00

Merge pull request #1339 from guntbert/iss1333

[csharp/en] Put demonstrative condition into ternary expression
This commit is contained in:
ven
2015-10-04 20:25:55 +02:00

View File

@@ -236,7 +236,8 @@ on a new line! ""Wow!"", the masses cried";
// Ternary operators
// A simple if/else can be written as follows
// <condition> ? <true> : <false>
string isTrue = (true) ? "True" : "False";
int toCompare = 17;
string isTrue = toCompare == 17 ? "True" : "False";
// While loop
int fooWhile = 0;