bool = !bool;

This holds true in most languages.