---
title: string function
description: Learn the syntax of the string function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/string
---

# `string` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Casts the value `expr` to `STRING`. This function is a synonym for `cast(expr AS STRING)`. See [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md) for details.

## Syntax

```
string(expr)
```

## Arguments

* `expr`: An expression that can be cast to `STRING`.

## Returns

A `STRING`.

If `expr` is not a `STRING`, the result `STRING` is assigned the [default collation](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-collation.md#default-collation).
Otherwise, the result collation matches the collation of `expr`.

## Examples

```sql
> SELECT string(5);
 5

> SELECT string(current_date);
 2021-04-01
```

## Related functions

* [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md)
