IsEven

        public static bool IsEven(this int value)
        {
            return value % 2 == 0;
        }
Example:
int number = 1;
bool isEven = number.IsEven(); // false

int number = 2;
bool isEven = number.IsEven(); // true

Description

Checks whether a number is even

Details

Double click on the code to select all.

 

;