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

# to_upper

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

```una
pub to_upper(t: Text) -> Text
  ensures result.len == t.len
```

`t` with the ASCII letters `a` to `z` in upper case (`spec/22 §3`).

## Parameters

- `t`: the text

## Returns

`Text`: `t` with the ASCII letters `a` to `z` in upper case and every other scalar value as it is\; the same length as `t`.

## See also

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

## Cost

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

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

## Example

`src/shop.una`

```una
module shop

--- An SKU typed in lower case. Only the ASCII letters change.
pub main() -> Unit
  uses @console: Console[print]
=
  @console.print("lamp-01".to_upper())
  @console.print("café-01".to_upper())
```

`una run .` prints:

```text
LAMP-01
CAFé-01
```

## Specification

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

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).
