Short-circuiting in C#
There will be lot of situations when you have introduced boolean expressions in your code and in good times you might have also combined more than one boolean expressions to control your program flow. Boolean Expression Any expression that can produce a boolean result can be considered as boolean expression. The end result will be boolean, i.e true or false. For example: x == y You can use Greater than >, Smaller than <, Greater than or equal to >=, Smaller than or equal to <=, equal to ==, Not equal to != equality operators to create a boolean expression. Combining Boolean Expression You can combine more than one boolean expressions using OR - ||, AND - && and EXCLUSIVE OR - ^ boolean operators. Short-circuiting - OR (||) boolean operator The OR - || boolean operator when applied returns true when any one of the two operand (or boolean expression) or both operand evaluates » Read more