(a) A demurrer to a complaint or cross-complaint may be taken to the whole complaint or cross-complaint or to any of the causes of action stated therein. (b) A demurrer to an answer may be taken to the whole answer or to any one or more of the several defenses set up in the answer. Ca. Civ. Proc. Code § 430.50 Added by Stats. 1971, Ch. 244.