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

# endswith (Column)

Check if a string column ends with a substring.

## Syntax

```python
endswith(other)
```

## Parameters

| Parameter | Type          | Description                                     |
| --------- | ------------- | ----------------------------------------------- |
| `other`   | str or Column | String or Column containing the suffix to check |

## Returns

Column (boolean)

## Examples

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

```Output
# [Row(age=2, name='Alice')]
```

```python
df.filter(df.name.endswith('ice$')).collect()
```

```Output
# []
```
