If the defendant, at any time before trial, offers in writing to allow judgment to be taken against him for a specified sum, the plaintiff may immediately have judgment therefor, with the costs then accrued. If he does not accept such offer before the trial, and fails to recover in the action a sum equal to the offer, he shall not recover costs accrued after the offer and costs shall be adjudged against him; but the offer and failure to accept it cannot be given in evidence, to affect the recovery, otherwise than as to costs as above provided.
Neb. Rev. Stat. §§ 25-2718