Costs shall be allowed as of course to the defendant, in the actions mentioned in G.S. 6-18 unless the plaintiff be entitled to costs therein. In all actions where there are several defendants not united in interest, and making separate defenses by separate answers, and the plaintiff fails to recover judgment against all, the court may award costs to such of the defendants as have judgment in their favor or any of them.
N.C. Gen. Stat. § 6-19