---
title: "contains function in Strata | Oplema"
description: "Check whether text contains a search string, returning true or false, or NULL for missing text. Use it in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/contains"
updated: "2026-11-04"
---

# contains

Check whether text contains a search string. It also checks a list for an item, a map for a key and an unnamed struct for a value.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **BOOLEAN**.

Example input

1. Row 1 `name = 'Ada Lovelace'`
2. Row 2 `name = 'Lin Chen'`
3. Row 3 `name = NULL`

### Expression

```
contains(name, 'Ada')
```

### Result

```
Row 1: true
Row 2: false
Row 3: NULL
```

NULL means the value is missing.

This Boolean expression also works in [Filter](https://oplema.com/docs/strata/prep/filter) custom mode. The True output receives rows 1; the False output receives rows 2, 3. A missing result goes to False.

Try it live in Formula

Result
| id | name | result |
| --- | --- | --- |
| 1 | Ada Lovelace | true |
| 2 | Lin Chen | false |
| 3 |  |  |

## Arguments and types

```
contains(value, search)
```

**string**

Text

**search\_string**

Text

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[ilike\_escape

Check whether text matches a LIKE pattern, ignoring uppercase and lowercase. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/ilike-escape)[instr

Find where a search string first appears in text, counting from 1. Returns 0 if there is no match.

](https://oplema.com/docs/strata/functions/instr)[like\_escape

Check whether text matches a LIKE pattern, treating uppercase and lowercase as different. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/like-escape)[position

Find where a search string first appears in text, counting from 1. Returns 0 if there is no match.

](https://oplema.com/docs/strata/functions/position)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#containsstring-search_string)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
