# IndexOf

## Overview

![The IndexOf Node.](https://640518663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEu3ZQiMi2jYaDHPO7K5c%2Fuploads%2Fgit-blob-c82145dbb0ad232b4e47ac1dac729d9bcef1a6ad%2Fnode-indexof.png?alt=media)

The **IndexOf** **Node** returns the index of the first occurrence of a *substring* in a **String** and a **Bool** indicating whether it was found or not.

The range in which the *substring* will be searched can be customized via the `StartIndex` and `EndIndex` **Attributes**.

## Attributes

| Attribute    | Type       | Description                                                                                      |
| ------------ | ---------- | ------------------------------------------------------------------------------------------------ |
| `String`     | **String** | The **String** in which the search will be performed., if none is given in the **Input Socket**. |
| `Pattern`    | **String** | The *substring* that will be searched for, if none is given in the **Input Socket**.             |
| `StartIndex` | **Int**    | *Index* of `String` in which the search will start, if none is given in the **Input Socket**.    |
| `EndIndex`   | **Int**    | *Index* of `String` in which the search will end, if none is given in the **Input Socket**.      |

## Inputs

| Input             | Type       | Description                                                           |
| ----------------- | ---------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**  | A standard **Input Pulse**, to trigger the execution of the **Node**. |
| `String`          | **String** | The **String** in which the search will be performed.                 |
| `Pattern`         | **String** | The *substring* that will be searched for.                            |
| `StartIndex`      | **Int**    | *Index* of `String` in which the search will start.                   |
| `EndIndex`        | **Int**    | *Index* of `String` in which the search will end.                     |

## Outputs

| Output             | Type      | Description                                                                                                                            |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse** | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `IndexOf`          | **Int**   | The *index* of the first occurrence of `Pattern` in `String`.                                                                          |
| `Found`            | **Bool**  | Whether `Pattern` was found in `String` or not.                                                                                        |

## See Also

* [**LastIndexOf**](https://docs.incari.com/incari-studio/2021.5/toolbox/string/lastindexof)

## External Links

* [*Substring*](https://en.wikipedia.org/wiki/Substring) on Wikipedia.
