---
schema_version: "1"
id: 7e01b98f9409c8acfc10a515781e2241d0c1091dbfe2ced99f14cd613bb495d7
title: capitalize
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-strings-functions-capitalize.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-strings-functions-capitalize
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 63c0227d1ff9426e23d4d717914e9e65981227b9fab358b47e8f5f9980bea2b2
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# capitalize

## [](#capitalize1)capitalize(text: String): String

文字列内の各単語の先頭を大文字にします。

この関数は、アルファベット以外のすべての文字を区切り文字として扱い、アンダースコアをスペースに置き換えます。たとえば、​`capitalize("a*s_b’s")`​ は ​`"A*S B’S"`​ になります。

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

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

### [](#例)例

次の例では、文字列セットの単語の先頭を大文字にします。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "a" : capitalize("customer"),
  "b" : capitalize("customer_first_name"),
  "c" : capitalize("customer NAME"),
  "d" : capitalize("customerName"),
  "e" : capitalize("a*s_b’s")
}
```

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

```JSON
{
  "a": "Customer",
  "b": "Customer First Name",
  "c": "Customer Name",
  "d": "Customer Name",
  "e": "A*S B’S"
}
```

## [](#capitalize2)capitalize(text: Null): Null

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