Friday, November 16, 2018

Testing new syntax

A colleague used some syntax that I hadn't seen before so I thought it would be worth testing in isolation.  The notation is an extension of the ternary conditional operator known as the null-conditional operator that was added as part of C# 6.0 in 2016.  I believe I need to up my C# game.  Anyway, here is the sample program I built:

which outputs:
=>
=>Test2
We build our code using the null-conditional operator to avoid having to build out the more common tertiary version of the same code:

1 comment:

  1. My favorite casino purely top online casino I recommend to everyone!!! The engine does not slow down. I did not observe any breaks in the connection. Won $ 2200. Brought the winnings to no problem. Very beautiful, pleasant, comfortable casino. Very nice voice acting. Honesty control. In short .. all zashib

    ReplyDelete