# text.compare_to · Rell standard library · Chromia Docs (concept)

> pure function compare_ to(other: text ): integer Compares this text to another text lexicographically, based on the Unicode value of each character
in each

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/compare_to/

FUNCTION

# text.compare\_to

```signature
pure function compare_to(other: text): integer
```

Compares this text to another text lexicographically, based on the Unicode value of each character
in each text object.

**Parameters**

* **other** — the text to compare against this text

**Returns**

`0` if this text and `other` are equal, a negative integer if lexicographically less than
`other`, and a positive integer if lexicographically greater than `other`.

Since 0.9.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/text/compare_to.html)Generated API reference, mirrored from the live docs
