---
schema_version: "1"
id: 5f1cccd8c3ee1dce8850b1022850a2849ff3fe5c44a4d5b10dc4e62e95b46eef
title: mapString
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-strings-functions-mapstring.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-strings-functions-mapstring
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7bc103bc9709bc041062b27050d3f55c9be349edafa2769bbb075fd7144401c5
description: MuleSoft Documentation Site
release: "2.4"
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 で導入されました。_​