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

# startswith (Column)

Check if a string column starts with a substring.

## Syntax

```python
startswith(other)
```

## Parameters

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

## Returns

Column (boolean)

## Examples

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

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

```python
df.filter(df.name.startswith('^Al')).collect()
```

```Output
# []
```
