Skip to content

starts_with ​

Checks that the value starts with one of the given strings.

Error codes: WRONG_FORMAT, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "website": "WRONG_FORMAT"
}

The arguments are one or more non-empty strings. The comparison is exact and case-sensitive; there is no normalization. The string form of the value is checked and returned.

js
{ website: { starts_with: ['https://', 'http://'] } }

See also ends_with and contains.