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

## [](#dasherize1)dasherize(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" : dasherize("customer"),
  "b" : dasherize("customer_first_name"),
  "c" : dasherize("customer NAME"),
  "d" : dasherize("customerName")
}
```

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

```JSON
{
  "a": "customer",
  "b": "customer-first-name",
  "c": "customer-name",
  "d": "customer-name"
}
```

## [](#dasherize2)dasherize(text: Null): Null

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