# CharCodeAt

## Overview

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

The **CharCodeAt** **Node** outputs the *ASCII* code of a character at a given *index* in a **String**. It takes as inputs a **String** and the *index* of the character whose code is to be obtained, and it ouputs the *ASCII* code of said character.

The characters' *indices* in the **String** start from zero.

If the index given is greater than the **String** length, the output is `-1`.

[**Scope**](https://docs.incari.com/incari-studio/2022.1/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

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

| Attribute | Type       | Description                                                                                                   |
| --------- | ---------- | ------------------------------------------------------------------------------------------------------------- |
| `String`  | **String** | The **String** from which the characters' codes are to be obtained, if none is given in the **Input Socket**. |
| `At`      | **Int**    | The index of the character whose *ASCII* code is to be obtained, 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** from which the characters' codes are to be obtained.   |
| `At`              | **Int**    | The index of the character whose *ASCII* code is to be obtained.      |

## 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. |
| `Char code`        | **Int**   | The *ASCII* code of the character at position `At` in `String`.                                                                        |

## External Links

* [*ASCII*](https://en.wikipedia.org/wiki/ASCII) on Wikipedia.
* [*HTML ASCII Reference*](https://www.w3schools.com/charsets/ref_html_ascii.asp) on W3Schools.
