# CharCodeAt

## Overview

![The CharCodeAt Node.](/files/rkGueYVuLuoT4tpTOCLK)

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**](/incari-studio/toolbox/overview.md#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The CharCodeAt Node Attributes.](/files/5N085qPKw1FsIWy3rNyS)

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


---

# 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/charcodeat.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.
