c# - Difference between list.Count > 0 and list.Count != 0 -


i have list of things. there difference between list.count > 0 , list.count != 0? or performance difference in these codes?

if (list.count > 0)     // stuff  if (list.count != 0)     // stuff 

note: list.count can't less ziro..

is there difference between list.count > 0 , list.count != 0?

yes. first 1 evaluates whether list.count greater 0. second 1 evaluates whether not equal 0. "greater than" , "not equal" different things.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -