J.C's C# How To
How to, idea, troubleshooting, anything else about C# -- base on VS2010
Feb 21, 2012
[Tips] ?: Operator and ?? Operator
Use "if" condition:
if (
condition
)
result =
t
;
else
result =
f
;
if (
obj
!= null)
result =
obj
;
else
result =
something
;
Use "?:" operator
result =
condition
?
t
:
f
;
Use "??" operator
result =
obj
??
something
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment