---
schema_version: "1"
id: 08765dcf93efe72d9c88df5a0f509da756a7832df3f571fb4cecef13306bf3b2
title: charCode
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-strings-functions-charcode.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-strings-functions-charcode
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 177b5919d161d5ab85520ff620a0b3970ae30706f2f7c662d6e49a5b8f11583a
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# charCode

## [](#charcode1)charCode(String): Number

入力文字列の最初の文字の Unicode を返します。

空の文字列の場合、この関数は失敗し、​`Unexpected empty string`​ を返します。

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

<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>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、「Mule」の「M」の Unicode を返します。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "charCode" : charCode("Mule")
}
```

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

```XML
{ "charCode" : 77 }
```