Zod · Method
.endsWith
.endsWith() validates that a string finishes with a given substring. Add it to a z.string() schema and parse input to apply the check.
Last updated
Syntax
z.string().endsWith(suffix)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
z.string()z.string().startsWith()z.string().includes()z.string().parse()