Zod · Method
.startsWith
Use .startsWith() to require that a string begins with a specified prefix. It is a built-in check on a Zod string schema.
Last updated
Syntax
z.string().startsWith(prefix, options?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
z.string()endsWithincludesregexminmaxparse