# IndexOf

## Overview

![The IndexOf Node.](/files/eXm8t6nVzGeNsYAgStGv)

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**.

[**Scope**](/incari-studio/toolbox/overview.md#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The IndexOf Node Attributes.](/files/JacVq8k6wurAs6arlg8C)

| 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**    | The *index* of `String` in which the search will start, if none is given in the **Input Socket**. |
| `EndIndex`   | **Int**    | The *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**    | The *index* of `String` in which the search will start.               |
| `EndIndex`        | **Int**    | The *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**](/incari-studio/toolbox/string/lastindexof.md)

## External Links

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.incari.com/incari-studio/toolbox/string/indexof.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
