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

## [](#hammingdistance1)hammingDistance(a: String, b: String): Number | Null

2 つの文字列間のハミング距離を返します。

_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>a</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>b</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">2 番目の文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな文字列での ​`hammingDistance`​ の動作を示します。

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

```DataWeave
%dw 2.0
import hammingDistance from dw::core::Strings
output application/json
---
"holu" hammingDistance "chau"
```

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

```Json
3
```