---
schema_version: "1"
id: 89ae526d59ef153bc40667c4a7ec28270170dcec2cceb44791ab9cb94931da7d
title: charCodeAt
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dw-strings-functions-charcodeat.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dw-strings-functions-charcodeat
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 24924957feffef475e67d74fe3c35f900c3bf593650d9dcd866346184df4fa61
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# charCodeAt

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## charCodeAt(content: String, position: Number): Number

Returns the Unicode for a character at the specified index.

This function fails if the index is invalid.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>content</code></p></td><td><p>The input string.</p></td></tr><tr><td><p><code>position</code></p></td><td><p>The index (a <code>Number</code> type) of a character in the string (as a string array). Note that the index of the first character is <code>0</code>.</p></td></tr></tbody></table>

### Example

This example returns Unicode for the "u" at index `1` in "MuleSoft".

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "charCodeAt" : charCodeAt("MuleSoft", 1)
}
```

#### Output

```JSON
{ "charCodeAt": 117 }
```

## charCodeAt(content: Null, position: Any): Null

Helper function that enables `charCodeAt` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
