---
title: "chars"
url: https://una-lang.org/en/docs/std/prelude/chars/
release: v0.4.0
edition: "0.2 and later"
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# chars

A function of the prelude, in scope in every module. Edition 0.2 and later.

```una
pub chars(t: Text) -> List[Text]
  ensures result.len == t.len
```

One text of length 1 per scalar value of `t`, in order (`spec/22 §2`).

## Parameters

- `t`: the text

## Returns

`List[Text]`: one text of length 1 per scalar value of `t`\, in order\; as many as `t.len`.

## See also

[`bytes`](https://una-lang.org/en/docs/std/prelude/bytes/), [`slice`](https://una-lang.org/en/docs/std/prelude/slice/)

## Cost

Time `O(b)` (ADR 0070), where:

- `b`: the length of `t` in UTF\-8 bytes

## Example

`src/shop.una`

```una
module shop

--- The characters of a product name, one by one: `é` is one scalar value.
pub main() -> Unit
  uses @console: Console[print]
=
  let letters = "Café".chars()
  @console.print(join(letters, separator: "|"))
  @console.print("{letters.len} characters")
```

`una run .` prints:

```text
C|a|f|é
4 characters
```

## Specification

- [`spec/22 §2`](https://una-lang.org/en/docs/spec/22-text/#s2)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
