Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

? operator

condition ? consequent : alternative

var rand = new Random();
var condition = rand.NextDouble() > 0.5;

var x = condition ? 12 : (int?)null;

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator
 
PREVIOUS NEXT
Tagged: #operator
ADD COMMENT
Topic
Name
6+9 =