---
schema_version: "1"
id: f739fb4415978705e63399fb986b503381f524b1f62c80b9d857cb3920996baa
title: underscore
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-strings-functions-underscore.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-strings-functions-underscore
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b684121af4a24840e107f437ef33885787ab68ccacb3d0972e4d8a1b84eecdd9
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# underscore

## [](#underscore1)underscore(text: String): 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>

### [](#例)例

次の例では、入力のハイフンとスペースを置き換えます。入力「customer」は、出力で変更されていません。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
   "a" : underscore("customer"),
   "b" : underscore("customer-first-name"),
   "c" : underscore("customer NAME"),
   "d" : underscore("customerName")
}
```

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

```JSON
{
   "a": "customer",
   "b": "customer_first_name",
   "c": "customer_name",
   "d": "customer_name"
}
```

## [](#underscore2)underscore(text: Null): Null

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