---
title: contains (Column)
description: "Column.contains method in PySpark: Check if a string column contains a substring."
canonical_url: https://docs.databricks.com/aws/en/pyspark/reference/classes/column/contains
---

# contains (Column)

Check if a string column contains a substring.

## Syntax

```python
contains(other)
```

## Parameters

| Parameter | Type          | Description                                             |
| --------- | ------------- | ------------------------------------------------------- |
| `other`   | str or Column | String or Column containing the substring to search for |

## Returns

Column (boolean)

## Examples

```python
df = spark.createDataFrame(
     [(2, "Alice"), (5, "Bob")], ["age", "name"])
df.filter(df.name.contains('o')).collect()
```

```Output
# [Row(age=5, name='Bob')]
```
