Skip to content

contains ​

Checks that the value contains at least one of the given strings.

Error codes: WRONG_FORMAT, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "comment": "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
{ comment: { contains: '@' } }

See also starts_with and ends_with.