v-max-length ( str n -- str )
Form validators

Prev:v-min-length ( str n -- str )
Next:v-min-value ( x n -- x )


Vocabulary
validators

Inputs and outputs
stra string
nan integer


Word description
Throws a validation error if the string is longer than n characters.

Definition


: v-max-length ( str n -- str )
over length over > [
[ "must be no more than " % # " characters" % ] "" make
throw
] [ drop ] if ;