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

## [](#charcode1)charCode(text: 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 }
```

## [](#charcode2)charCode(text: Null): Null

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

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