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

## [](#mapstring1)mapString(@StreamCapable text: String, mapper: (character: String, index: Number) -> String): String

文字列のすべての文字に式を適用します。

_DataWeave バージョン 2.4.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>mapper</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code>​ 文字列の各文字 (​<code>$</code>​) またはインデックス (​<code>$</code>​) に適用して文字列を返す式。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、文字列の機密データを編集しています。

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

```DataWeave
%dw 2.0
import * from dw::core::Strings
output application/json
---
{ balance: ("\$234" mapString if (isNumeric($)) "~" else $) }
```

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

```Json
{
  "balance": "$~~~"
}
```

## [](#mapstring2)mapString(@StreamCapable text: Null, mapper: (character: Nothing, index: Nothing) -> Any): Null

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

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