---
schema_version: "1"
id: 38dde2be41b400d4bb9ac18f3a6e75f4c1fbac9bfb6cd8eb2fc251c726ad6144
title: rightPad
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-strings-functions-rightpad.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-strings-functions-rightpad
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 83ce488d6691dc4f76c320668d91dbe06ef88ae600ed6fc04574a6f56b06e525
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# rightPad

## [](#rightpad1)rightPad(String, Number, String): String

目的のサイズ (​`size`​) になるように、指定された ​`text`​ の​_右_​側に ​`padText`​ を埋め込みます。 デフォルトの ​`padText`​ は ​`" "`​ です。

右側をパディングした ​`String`​ を返すか、パディングが不要な場合は元の ​`String`​ を返します。

_DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。_​

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

<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>size</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>padText</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">埋め込むテキスト。指定されていない場合、デフォルトで 1 桁の空白に設定されます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

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

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "a": rightPad(null, 3),
  "b": rightPad("", 3),
  "c": rightPad("bat", 5),
  "d": rightPad("bat", 3),
  "e": rightPad("bat", -1)
}
```

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

```JSON
{
  "a": null,
  "b": "   ",
  "c": "bat  ",
  "d": "bat",
  "e": "bat"
}
```

## [](#rightpad2)rightPad(Null, Number, String): Null

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