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

## [](#repeat1)repeat(text: String, times: Number): String

`text`​ を、指定された回数 (​`times`​) 繰り返します。

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

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

<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>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>times</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">文字を繰り返す回数。負の値はゼロとして処理されます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力とサイズでの ​`repeat`​ の動作を示します。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "a": repeat("e", 0),
  "b": repeat("e", 3),
  "c": repeat("e", -2)
}
```

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

```JSON
{
  "a": "",
  "b": "eee",
  "c": ""
}
```

## [](#repeat2)repeat(text: Null, times: Any): Null

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

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