In a court of law, whether of original jurisdiction or of error, upon a voluntary or involuntary discontinuance or dismissal of the action, there shall be judgment for costs for the defendant. Generally a party for whom final judgment in any civil action, or on a writ of error upon a judgment is given in such action, shall recover, against the adverse party, costs of suit, to be awarded by the court.
Code 1852, § 2525; Code 1915, § 4444; Code 1935, § 4902; 10 Del. C. 1953, § 5101.