Snippet: conditional operator (not equal to null)

property value
IDE VS Code
Language C#
Title conditional operator (not equal to null)
Shortcut coxn
Description conditional operator with condition whether the expression is not equal to null

Placeholders

Identifier Tooltip Default Value
expression Expression to evaluate expression
false False expression false
true True expression true

Code

(expression != null) ? true : false