Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

ternary operator in c#

Object obj = null
//    is this condition true ? yes : no
var output = (obj == null) ? "Yes" : "No";

// output = "yes"
 
PREVIOUS NEXT
Tagged: #ternary #operator
ADD COMMENT
Topic
Name
7+4 =