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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -