> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/everyware/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/everyware/starter-kit-packages/everyware-twig/development/operators/contains.md).

# contains

The *contains* operator can confirm the existence of words or sentence in a string.

Check for a single word:

```php
{% if 'string that contains foo' contains 'foo' %}
    // Do something if the string contains the word "foo"
{% endif %}
```

You can also negate the check

```php
{% if not 'string that contains foo' contains 'not' %}
    // Do something if the string dose not contain the word "not"
{% endif %}
```

Check for one of multiple matches:

```php
{% if 'string that contains foo' contains ['no match', 'other match', 'foo'] %}
    // Do something if the string contains either of the provided words
{% endif %}
```
