expression - Is there a shorthand for smaller than AND greater than, in C#? -
is there shorthand this:
bool b = (x > 0) && (x < 5);
something like:
bool b = 0 < x < 5;
in c#?
nope. can remove brackets:
bool b = 0 < x && x < 5
or play math:
bool b = x*x < 5*x
Comments
Post a Comment