---
schema_version: "1"
id: 896d4a4495892d1ba59b99486bdbb869f3859304ae900026533f51bb43a85245
title: charCodeAt
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-strings-functions-charcodeat.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-strings-functions-charcodeat
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 845e969e5a16c502fc3c2315021a1d5c35545d246aa68fa2b9fb6e58b7fa34f5
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# charCodeAt

## [](#charcodeat1)charCodeAt(content: String, position: Number): Number

指定されたインデックスの文字の Unicode を返します。

インデックスが無効の場合、この関数は失敗します。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>content</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力文字列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>position</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">文字列 (文字列配列) 内の文字のインデックス (​<code>Number</code>​ 型)。最初の文字のインデックスは ​<code>0</code>​ であることに注意してください。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、「MuleSoft」のインデックス ​`1`​ にある「u」の Unicode を返します。

#### [](#ソース)ソース

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

#### [](#出力)出力

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

## [](#charcodeat2)charCodeAt(content: Null, position: Any): Null

`charCodeAt`​ を ​`null`​ 値に使用できるようにするヘルパー関数。

_DataWeave バージョン 2.4.0 で導入されました。_​