Tech Stuff with Rybo
An overview of technical problems and my solutions for them.
Monday, June 15, 2009
Question Mark Operator C#
The question mark operator is a 'ternary' operator that allows a conditional statement to be written in one line.
if a function returns a boolean :
return someVar == anotherVar ? true : false;
is equivalent to
if(someVar == anotherVar)
{
return true;
}
else
{
return false;
]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment