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

> type text An immutable character string data type. Since 0.6.0 Methods charAt Retrieves the 16-bit code of the character at the specified index within this

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

TYPE

# text

```signature
type text
```

An immutable character string data type.

Since 0.6.0

## Methods

[charAt](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/char-at/)
:   Retrieves the 16-bit code of the character at the specified index within this text.

[char\_at](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/char_at/)
:   Retrieves the 16-bit code of the character at the specified index within this text.

[compareTo](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/compare-to/)
:   Compares this text to another text lexicographically, based on the Unicode value of each character

[compare\_to](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/compare_to/)
:   Compares this text to another text lexicographically, based on the Unicode value of each character

[contains](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/contains/)
:   Checks if this text contains the specified substring.

[empty](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/empty/)
:   Returns true if this text is empty, false otherwise.

[encode](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/encode/)
:   Converts this text to an array of UTF-8 encoded bytes.

[endsWith](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/ends-with/)
:   Checks if this text ends with the specified suffix.

[ends\_with](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/ends_with/)
:   Checks if this text ends with the specified suffix.

[format](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/format/)
:   Uses this text as a format string and returns the text obtained by substituting the specified

[from\_bytes](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/from_bytes/)
:   Create a text representation of the given bytes.

[indexOf](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/index-of/)
:   Search for the first occurrence of the specified substring within this text.

[index\_of](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/index_of/)
:   Search for the first occurrence of the specified substring within this text.

[lastIndexOf](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/last-index-of/)
:   Returns the index within this text of the last occurrence of the specified string,

[last\_index\_of](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/last_index_of/)
:   Returns the index within this text of the last occurrence of the specified string,

[len](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/len/)
:   Returns the number of characters in this text.

[like](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/like/)
:   Matches this text against the specified SQL LIKE pattern.

[lowerCase](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/lower-case/)
:   Returns the text obtained by converting all alphabetic characters in this text to lower case.

[lower\_case](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/lower_case/)
:   Returns the text obtained by converting all alphabetic characters in this text to lower case.

[match\_groups](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/match_groups/)
:   Match this text against the specified regular expression, returning all match groups in a list.

[match\_named\_groups](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/match_named_groups/)
:   Match this text against the specified regular expression, returning a map whose keys are the names

[matches](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/matches/)
:   Matches this text against the specified regular expression.

[regex\_replace](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/regex_replace/)
:   Returns the text obtained by replacing all subsequences in this text which match the given regular

[repeat](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/repeat/)
:   Repeat this text n times. SQL compatible.

[replace](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/replace/)
:   Returns the text obtained by replacing all occurrences of the substring oldvalue in this text

[reversed](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/reversed/)
:   Returns a reversed copy of this text. SQL compatible.

[size](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/size/)
:   Returns the number of characters in this text.

[split](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/split/)
:   Splits this text around matches of the given delimiter.

[startsWith](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/starts-with/)
:   Checks if this text starts with the specified prefix.

[starts\_with](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/starts_with/)
:   Checks if this text starts with the specified prefix.

[sub](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/sub/)
:   Returns a substring of this text starting from the specified index (inclusive).

[to\_bytes](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/to_bytes/)
:   Converts this text to an array of UTF-8 encoded bytes.

[trim](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/trim/)
:   Returns text matching this one, but with leading and trailing whitespace removed.

[upperCase](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/upper-case/)
:   Returns the text obtained by converting all alphabetic characters in this text to upper case.

[upper\_case](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/upper_case/)
:   Returns the text obtained by converting all alphabetic characters in this text to upper case.

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