> ## Content Index
> Fetch the complete content index at: https://getpublii.com/dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# {{#contains}} helper

- URL: https://getpublii.com/dev/contains-helper/
- Published: 2019-07-11T18:29:57.903Z
- Updated: 2024-02-08T09:21:09.769Z
- Description: If you need to check if some value exists in a given string which contains values separated by comma - use the {{#contains}} helper. Syntax:…
- Author: Tomasz Dziuda
- Tags: Helpers

If you need to check if some value exists in a given string which contains values separated by comma - use the {{#contains}} helper.

Syntax:

```handlebars
{{#contains valueToCheck valueToSearch}}
   // if the valueToCheck exists inside the valueToSearch
{{/contains}}
```

Examples:

```handlebars
{{#contains 'abc' 'abc,def'}}
abc,def contains abc
{{/contains}}

```

```handlebars
{{#contains 1 'a,1,2,d,e,f'}}
a,1,2,d,e,f contains 1
{{/contains}}
```

As you can see above - it also supports numbers, so if your string contains numbers you haven't to cast your first argument to string.

Examples output:

```handlebars
abc,def contains abc
```

```handlebars
a,1,2,d,e,f contains 1
```
