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, enter the expression and set Output type to BOOLEAN.
Example input
- Row 1
name = 'Ada Lovelace' - Row 2
name = 'Lin Chen' - Row 3
name = NULL
Expression
contains(name, 'Ada')Result
Row 1: true
Row 2: false
Row 3: NULLNULL means the value is missing.
This Boolean expression also works in Filter custom mode. The True output receives rows 1; the False output receives rows 2, 3. A missing result goes to False.
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.
Function metadata from DuckDB, used under the MIT license.