# length

[Read this page in HTML](https://www.scopedb.io/docs/reference/functions/string/length)

Counts the Unicode characters in a string.

## Syntax

```scopeql
length(<string>)
```

## Arguments

| Argument   | Type     | Description        |
| ---------- | -------- | ------------------ |
| `<string>` | `string` | String to measure. |

## Returns

Returns `int`. Counts Unicode characters, not UTF-8 bytes. An empty string has length 0. Returns NULL if the input is NULL.

## Examples

Measure the length of customer feedback, including text with non-ASCII characters.

```scopeql
VALUES ('call-17', 'Payment was slow'), ('call-42', '结账很慢')
SELECT $0 AS call_id, $1 AS feedback
SELECT call_id, feedback, length(feedback) AS characters
```

```text
+---------+------------------+------------+
| call_id | feedback         | characters |
+---------+------------------+------------+
| call-17 | Payment was slow | 16         |
| call-42 | 结账很慢         | 4          |
+---------+------------------+------------+
```
