Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

ternary operator 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
8+8 =