
70 Cal.App.2d 238 (1945)
SAM GERSTEIN, Appellant,
v.
HELEN V. SMIRL, Respondent.
Civ. No. 14799. 
California Court of Appeals. Second Dist., Div. One.  
July 20, 1945.
 Mitchell & Gold and Seymour Gold for Appellant.
 Parker & Stanbury and Harry D. Parker for Respondent.
 WHITE, J.
 Plaintiff instituted this action to recover damages allegedly sustained by him in an automobile accident as the result of defendant's negligence. By her answer defendant denied any negligence upon her part, alleged contributory negligence on the part of plaintiff, and by cross-complaint sought to recover damages allegedly suffered by her in the same accident. Upon trial of the action, the jury returned a verdict denying relief to both parties under their respective pleadings. Defendant filed a memorandum of costs and disbursements, and judgment was entered upon the verdict that plaintiff recover nothing from defendant, and that "said cross-complainant, Helen V. Smirl, recover from said cross-defendant, Sam Gerstein, nothing, together with costs and disbursements incurred in this action amounting to the sum of $147.80."
 Thereafter, appellant moved to retax costs and to strike out defendant's cost bill on the ground (among others not raised on appeal) "that in said action a cross-complaint was filed by Helen V. Smirl against Sam Gerstein ... and ... that both the complaint and cross-complaint were tried at one and the same time by the same evidence, by the same jury and with the same witnesses and that it cannot be determined to which portion of the action the costs are attributable inasmuch as the costs were attributable to both the complaint and the cross-complaint." Plaintiff has appealed from the judgment and from the order denying said motion.
 [1a] The sole question presented by this appeal is whether a defendant who is awarded nothing on his cross-complaint is entitled to recover costs of suit from an unsuccessful plaintiff.
 "The right to recover costs is entirely statutory and 'the measure of the statute is the measure of the right'" (Estate of Johnson, 198 Cal. 469, 471 [245 P. 1089]; Moss v. Underwriters' Report, Inc., 12 Cal.2d 266, 274 [83 P.2d 503]). "In the superior court ... costs are allowed of course: ... to the defendant upon a judgment in his favor" in "an action *240 for the recovery of money or damages" (Code Civ. Proc.,  1032). If defendant's answer had been her only pleading, then unquestionably the judgment that plaintiff take nothing would have been a judgment in favor of defendant, entitling her to costs as a matter of right. But appellant urges that, when defendant filed her cross-complaint, she ceased to be a "defendant" entitled to her costs as a matter of right in the event of plaintiff's failure to recover judgment against her, and she then became a "cross-complainant" entitled to recover no costs if "the judgment for the defendant on the cross-complaint does not exceed that of plaintiff on the complaint." We know of no California case determinative of this precise question. However, from time to time, in actions where counterclaims and cross-complaints have been filed, various questions concerning costs have been decided.
 [2] It is well settled that, where both plaintiff and cross-complainant recover money judgments, a defendant to whom the "net result of the judgment" is favorable is entitled to recover all his costs (Shelley v. Hart, 112 Cal.App. 231, 243 [297 P. 82]; Dobbins v. Horsfall, 58 Cal.App.2d 23, 27 [136 P.2d 35]). If the "net result" of a judgment is favorable to plaintiff, unless it (in its net amount) is one which "could have been rendered by a municipal or inferior court within the same county," plaintiff's costs are "allowed of course" (Code Civ. Proc.,  1032; Quitzow v. Perrin, 120 Cal. 255 [52 P. 632]; Hansen v. Covell, 218 Cal. 622, 632 [24 P.2d 772, 89 A.L.R. 670]).
 [1b] The action here in question was initiated by plaintiff against defendant to recover damages. By their verdict the jury found that both plaintiff and defendant were at fault, or that neither was to blame. In any event, the finding of the jury was that plaintiff had no cause to bring suit against the defendant. Had defendant been let alone she might never have appealed to the courts for redress. However, when plaintiff chose to commence legal action, defendant was required to set up her counterclaims for any damages allegedly sustained by her arising out of the transaction set forth in plaintiff's complaint or be foreclosed from thereafter maintaining an action against the plaintiff therefor (Code Civ. Proc.,  438, 439, 442; Gorman v. Superior Court, 23 Cal.App.2d 173 [72 P.2d 774]).
 As we read section 1032, it is intended thereby that, if plaintiff in an action fails to make out his case, the defendant is *241 entitled to judgment and must be regarded as the prevailing party. In other words, a party who defeats an action by a counterclaim is as much entitled to his costs as is a party who defeats it by any other means. In an action such as the instant one for damages, the "net result" of a judgment requiring defendant to pay nothing to the plaintiff is favorable to the former. Although defendant did not recover on her cross-complaint, she was the prevailing party in the court below because plaintiff was denied recovery against her. The statute (Code Civ. Proc.,  1032(b)) provides that "costs are allowed of course ... to the defendant upon a judgment in his favor." It does not lie within the province of the court to engraft upon the statute a provision that, although a defendant has defeated plaintiff's claim, he shall nevertheless be deprived of his costs because he sets up a counterclaim in conformity with the aforesaid sections of the Code of Civil Procedure rather than waive his right to proceed against plaintiff upon a cause of action which grows out of the transaction that gave rise to plaintiff's complaint. The trial court therefore properly denied plaintiff's motion to strike out defendant's cost bill.
 The judgment and order appealed from are affirmed.
 York, P. J., and Doran, J., concurred.
