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

> pure function compareTo(other: text ): integer Deprecated (for removal): Use 'compare_to' instead Compares this text to another text lexicographically, bas

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

FUNCTION

# text.compareTo

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

**Deprecated** (for removal): Use 'compare\_to' instead

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

**Alias of** [text.compare\_to](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/compare_to/)

[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
