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 -

mongodb - Multiple $and with multiple $or in $match mongoose -

Teradata TPT_INFRA: TPT02640: Error: Conflicting column count -