---
schema_version: "1"
id: 7c678f147a245967b3cd0356158b10b054004b248ddb48eb23bfce0411326bf3
title: levenshteinDistance
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-strings-functions-levenshteindistance.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-strings-functions-levenshteindistance
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0e9ac718fa7c4799087f05587b1d4c18e26a58115c1f0565dfe3b32eb89ff59e
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# levenshteinDistance

## [](#levenshteindistance1)levenshteinDistance(a: String, b: String): Number

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>

### [](#例)例

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

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

```DataWeave
%dw 2.0
import levenshteinDistance from dw::core::Strings
output application/json
---
"kitten" levenshteinDistance "sitting"
```

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

```Json
3
```