# LastIndexOf

## Overview

![The LastIndexOf Node.](https://926825830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKQhJdUBr7YQzfIwmpAZ9%2Fuploads%2Fgit-blob-9c4c26f446f6f4c4d6613bcbebadae809a42c38b%2Flastindexofnode.png?alt=media)

The **LastIndexOf** **Node** returns the index of the last 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**](https://docs.incari.com/incari-studio/2022.1/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The LastIndexOf Node Attributes.](https://926825830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKQhJdUBr7YQzfIwmpAZ9%2Fuploads%2Fgit-blob-82293ae54d5fffb65495be79b9bffbbe457622d4%2Flastindexofattributes.png?alt=media)

| Attribute    | Type       | Description                                             |
| ------------ | ---------- | ------------------------------------------------------- |
| `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.   |

## 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. |
| `LastIndexOf`      | **Int**   | The *index* of the last occurrence of `Pattern` in `String`.                                                                           |
| `Found`            | **Bool**  | Whether `Pattern` was found in `String` or not.                                                                                        |

## See Also

* [**IndexOf**](https://docs.incari.com/incari-studio/2022.1/toolbox/string/indexof)

## External Links

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