---
schema_version: "1"
id: e31e848a1ffb0a7fd84e65d9039131c5fd5905d4f50dc5dd0fd009d36e82071e
title: levenshteinDistance
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-strings-functions-levenshteindistance.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-strings-functions-levenshteindistance
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 170d036b700947895d00a807e4abfd133256e0855155eb76b55690ba85f5ff9b
description: MuleSoft Documentation Site
release: "2.6"
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
```