# string

Casts an expression to a string.

```tql
string(x:any) -> string
```

## Description

The `string` function casts the given value `x` to a string.

## Examples

### Cast an IP address to a string

```tql
from {x: string(1.2.3.4)}
```

```tql
{x: "1.2.3.4"}
```

## See Also

* [`float`](https://preview.docs.tenzir.com/375/375/reference/functions/float.md)
* [`int`](https://preview.docs.tenzir.com/375/375/reference/functions/int.md)
* [`ip`](https://preview.docs.tenzir.com/375/375/reference/functions/ip.md)
* [`subnet`](https://preview.docs.tenzir.com/375/375/reference/functions/subnet.md)
* [`time`](https://preview.docs.tenzir.com/375/375/reference/functions/time.md)
* [`uint`](https://preview.docs.tenzir.com/375/375/reference/functions/uint.md)
* [Transform values](https://preview.docs.tenzir.com/375/375/guides/transformation/transform-values.md)
* [Learn idiomatic TQL](https://preview.docs.tenzir.com/375/375/tutorials/learn-idiomatic-tql.md)