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

> pure function indexOf(text: text ): integer Deprecated (for removal): Use 'index_of' instead Search for the first occurrence of the specified substring wit

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

FUNCTION

# text.indexOf

```signature
pure function indexOf(text: text): integer
```

**Deprecated** (for removal): Use 'index\_of' instead

Search for the first occurrence of the specified substring within this text.

**Parameters**

* **text** — the substring for which to search

**Returns**

the index of the first occurrence of the substring within this text, or `-1` if
the substring does not occur in this text

Since 0.9.0

**Alias of** [text.index\_of](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/index_of/)

---

```signature
pure function indexOf(text: text, start: integer): integer
```

**Deprecated** (for removal): Use 'index\_of' instead

Returns the position of the first occurrence of the specified substring within this text,
starting at the specified index, or -1 if the text is not found.

**Parameters**

* **text** — the substring for which to search
* **start** — the index from which to start the search

Since 0.9.0

**Alias of** [text.index\_of](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/index_of/)

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