Soenneker.Utils.Strings.LevenshteinDistance 3.0.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.Strings.LevenshteinDistance --version 3.0.1
                    
NuGet\Install-Package Soenneker.Utils.Strings.LevenshteinDistance -Version 3.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Utils.Strings.LevenshteinDistance" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Strings.LevenshteinDistance" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.Strings.LevenshteinDistance" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Utils.Strings.LevenshteinDistance --version 3.0.1
                    
#r "nuget: Soenneker.Utils.Strings.LevenshteinDistance, 3.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Soenneker.Utils.Strings.LevenshteinDistance&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Strings.LevenshteinDistance&version=3.0.1
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Utils.Strings.LevenshteinDistance

A utility library for comparing strings via the Levenshtein Distance algorithm

Installation

dotnet add package Soenneker.Utils.Strings.LevenshteinDistance

Why Levenshtein Distance?

Levenshtein Distance, also known as Edit Distance, is a widely used metric for measuring the similarity between two strings. It calculates the minimum number of operations required to transform one string into the other, where operations include:

  • Insertion of a character.
  • Deletion of a character.
  • Substitution of a character.

Levenshtein Distance is particularly useful in applications like:

Flexible String Comparison:

It handles strings of unequal length and allows for more flexible comparisons.

Real-World Scenarios:

It's well-suited for tasks like:

  • Fuzzy string matching.
  • Spelling correction.
  • DNA sequence analysis.
  • Natural language processing.

Position-Aware:

It captures positional changes and structural differences more effectively than set-based metrics like Jaccard or Hamming Distance.

Comprehensive Error Handling:

Unlike simpler metrics, it accounts for insertions and deletions, making it robust for strings with typos or omissions.


Usage

var text1 = "kitten";
var text2 = "sitting";

int distance = LevenshteinDistanceUtil.ComputeDistance(text1, text2); // 3
double similarityPercentage = LevenshteinDistanceUtil.CalculatePercentage(text1, text2); // ~57.14

This library is efficient, straightforward, and ideal for handling real-world string similarity comparisons where flexibility and accuracy are key.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.305 29 6/27/2025
3.0.304 143 5/27/2025
3.0.303 144 5/22/2025
3.0.302 141 5/7/2025
3.0.301 139 5/5/2025
3.0.300 141 5/5/2025
3.0.299 142 5/5/2025
3.0.298 156 4/8/2025
3.0.297 149 4/8/2025
3.0.296 152 4/8/2025
3.0.295 153 4/8/2025
3.0.294 148 4/8/2025
3.0.293 157 4/8/2025
3.0.292 155 4/7/2025
3.0.291 152 4/7/2025
3.0.290 146 4/7/2025
3.0.289 153 4/7/2025
3.0.288 157 4/7/2025
3.0.287 158 4/7/2025
3.0.286 157 4/7/2025
3.0.285 158 4/7/2025
3.0.284 156 4/6/2025
3.0.283 155 4/6/2025
3.0.282 127 4/6/2025
3.0.281 144 4/6/2025
3.0.280 107 4/6/2025
3.0.279 102 4/6/2025
3.0.278 104 4/5/2025
3.0.277 80 4/5/2025
3.0.276 85 4/5/2025
3.0.275 79 4/5/2025
3.0.274 82 4/5/2025
3.0.273 87 4/5/2025
3.0.272 85 4/5/2025
3.0.271 101 4/4/2025
3.0.270 150 4/4/2025
3.0.269 141 4/1/2025
3.0.268 136 3/31/2025
3.0.267 151 3/31/2025
3.0.266 79 3/29/2025
3.0.265 459 3/25/2025
3.0.264 471 3/25/2025
3.0.263 117 3/21/2025
3.0.262 139 3/18/2025
3.0.261 143 3/18/2025
3.0.260 75 3/15/2025
3.0.259 65 3/15/2025
3.0.258 60 3/15/2025
3.0.257 157 3/12/2025
3.0.256 152 3/12/2025
3.0.255 157 3/12/2025
3.0.254 168 3/11/2025
3.0.253 160 3/11/2025
3.0.252 164 3/11/2025
3.0.251 164 3/11/2025
3.0.250 156 3/11/2025
3.0.249 223 3/7/2025
3.0.248 212 3/7/2025
3.0.247 89 3/2/2025
3.0.246 94 3/2/2025
3.0.245 96 3/2/2025
3.0.244 90 3/2/2025
3.0.243 95 3/2/2025
3.0.242 91 3/1/2025
3.0.241 96 3/1/2025
3.0.240 86 3/1/2025
3.0.239 86 3/1/2025
3.0.238 95 3/1/2025
3.0.237 92 2/25/2025
3.0.236 100 2/25/2025
3.0.235 97 2/25/2025
3.0.234 91 2/25/2025
3.0.233 99 2/24/2025
3.0.232 102 2/23/2025
3.0.231 89 2/23/2025
3.0.230 97 2/22/2025
3.0.229 96 2/22/2025
3.0.228 91 2/22/2025
3.0.227 109 2/22/2025
3.0.226 91 2/22/2025
3.0.225 94 2/22/2025
3.0.224 97 2/21/2025
3.0.223 104 2/21/2025
3.0.222 100 2/19/2025
3.0.221 99 2/19/2025
3.0.220 97 2/19/2025
3.0.219 100 2/19/2025
3.0.218 104 2/18/2025
3.0.217 100 2/18/2025
3.0.216 106 2/18/2025
3.0.215 104 2/14/2025
3.0.214 107 2/14/2025
3.0.213 107 2/13/2025
3.0.212 102 2/12/2025
3.0.211 105 2/12/2025
3.0.210 104 2/12/2025
3.0.209 108 2/12/2025
3.0.208 101 2/12/2025
3.0.207 101 2/11/2025
3.0.206 108 2/11/2025
3.0.205 107 2/11/2025
3.0.204 103 2/11/2025
3.0.203 102 2/11/2025
3.0.202 107 2/10/2025
3.0.201 111 2/10/2025
3.0.200 116 2/10/2025
3.0.199 109 2/10/2025
3.0.198 101 2/10/2025
3.0.197 114 2/9/2025
3.0.196 98 2/8/2025
3.0.195 97 2/8/2025
3.0.194 92 2/8/2025
3.0.193 98 2/8/2025
3.0.192 93 2/8/2025
3.0.191 93 2/7/2025
3.0.190 95 2/7/2025
3.0.189 105 2/7/2025
3.0.188 100 2/7/2025
3.0.187 107 2/7/2025
3.0.186 101 2/7/2025
3.0.185 96 2/7/2025
3.0.184 93 2/7/2025
3.0.183 92 2/6/2025
3.0.182 96 2/5/2025
3.0.181 98 2/5/2025
3.0.180 98 2/5/2025
3.0.179 97 2/5/2025
3.0.178 94 2/5/2025
3.0.177 96 2/5/2025
3.0.176 108 2/5/2025
3.0.175 98 1/28/2025
3.0.174 90 1/28/2025
3.0.173 90 1/28/2025
3.0.172 95 1/28/2025
3.0.171 83 1/27/2025
3.0.170 93 1/27/2025
3.0.169 92 1/26/2025
3.0.168 88 1/26/2025
3.0.167 92 1/26/2025
3.0.166 92 1/25/2025
3.0.165 98 1/25/2025
3.0.164 96 1/25/2025
3.0.163 97 1/25/2025
3.0.162 91 1/25/2025
3.0.161 91 1/25/2025
3.0.160 84 1/24/2025
3.0.159 84 1/24/2025
3.0.158 86 1/24/2025
3.0.157 92 1/24/2025
3.0.156 97 1/24/2025
3.0.155 91 1/23/2025
3.0.154 98 1/23/2025
3.0.153 98 1/21/2025
3.0.152 86 1/21/2025
3.0.151 98 1/21/2025
3.0.150 96 1/21/2025
3.0.149 103 1/21/2025
3.0.148 94 1/21/2025
3.0.147 102 1/21/2025
3.0.146 93 1/20/2025
3.0.145 83 1/20/2025
3.0.144 95 1/20/2025
3.0.143 91 1/20/2025
3.0.142 102 1/20/2025
3.0.141 96 1/20/2025
3.0.140 87 1/19/2025
3.0.139 92 1/19/2025
3.0.138 88 1/19/2025
3.0.137 92 1/19/2025
3.0.136 86 1/19/2025
3.0.135 87 1/19/2025
3.0.134 79 1/19/2025
3.0.133 92 1/18/2025
3.0.132 97 1/18/2025
3.0.131 83 1/18/2025
3.0.130 87 1/18/2025
3.0.129 91 1/17/2025
3.0.128 85 1/17/2025
3.0.127 90 1/17/2025
3.0.126 87 1/17/2025
3.0.125 88 1/17/2025
3.0.124 88 1/17/2025
3.0.123 87 1/16/2025
3.0.122 87 1/16/2025
3.0.121 79 1/16/2025
3.0.120 87 1/16/2025
3.0.119 88 1/16/2025
3.0.118 86 1/16/2025
3.0.117 91 1/15/2025
3.0.116 90 1/15/2025
3.0.115 82 1/15/2025
3.0.114 77 1/15/2025
3.0.113 66 1/15/2025
3.0.112 71 1/15/2025
3.0.111 71 1/15/2025
3.0.110 54 1/15/2025
3.0.109 67 1/14/2025
3.0.108 68 1/14/2025
3.0.107 71 1/14/2025
3.0.106 92 1/14/2025
3.0.105 79 1/13/2025
3.0.104 78 1/13/2025
3.0.103 80 1/12/2025
3.0.102 86 1/11/2025
3.0.101 101 1/11/2025
3.0.100 92 1/11/2025
3.0.99 90 1/10/2025
3.0.98 105 1/10/2025
3.0.97 93 1/10/2025
3.0.96 88 1/10/2025
3.0.95 117 1/3/2025
3.0.94 124 1/3/2025
3.0.93 99 1/3/2025
3.0.92 104 1/3/2025
3.0.91 105 1/2/2025
3.0.90 97 1/2/2025
3.0.89 105 1/2/2025
3.0.88 101 1/2/2025
3.0.87 108 1/1/2025
3.0.86 115 1/1/2025
3.0.85 103 1/1/2025
3.0.84 109 1/1/2025
3.0.83 111 1/1/2025
3.0.82 105 1/1/2025
3.0.81 102 12/31/2024
3.0.80 113 12/31/2024
3.0.79 118 12/31/2024
3.0.77 123 12/31/2024
3.0.76 130 12/31/2024
3.0.75 119 12/31/2024
3.0.74 100 12/31/2024
3.0.73 96 12/31/2024
3.0.72 106 12/31/2024
3.0.71 121 12/31/2024
3.0.70 101 12/31/2024
3.0.69 100 12/30/2024
3.0.68 104 12/28/2024
3.0.67 99 12/28/2024
3.0.66 103 12/27/2024
3.0.65 102 12/27/2024
3.0.64 94 12/24/2024
3.0.63 94 12/24/2024
3.0.62 96 12/24/2024
3.0.61 97 12/24/2024
3.0.60 95 12/24/2024
3.0.59 96 12/24/2024
3.0.58 89 12/24/2024
3.0.57 98 12/24/2024
3.0.56 102 12/24/2024
3.0.55 96 12/24/2024
3.0.54 92 12/23/2024
3.0.53 96 12/23/2024
3.0.52 95 12/23/2024
3.0.51 92 12/23/2024
3.0.50 102 12/23/2024
3.0.49 108 12/23/2024
3.0.48 97 12/22/2024
3.0.47 98 12/22/2024
3.0.46 125 12/22/2024
3.0.45 101 12/22/2024
3.0.44 99 12/22/2024
3.0.43 107 12/22/2024
3.0.42 103 12/22/2024
3.0.41 100 12/21/2024
3.0.40 103 12/21/2024
3.0.39 107 12/21/2024
3.0.38 111 12/21/2024
3.0.37 98 12/21/2024
3.0.36 95 12/21/2024
3.0.35 104 12/20/2024
3.0.34 105 12/20/2024
3.0.33 101 12/20/2024
3.0.32 102 12/20/2024
3.0.31 98 12/20/2024
3.0.30 105 12/19/2024
3.0.29 94 12/19/2024
3.0.28 96 12/19/2024
3.0.27 112 12/18/2024
3.0.26 102 12/18/2024
3.0.25 94 12/16/2024
3.0.24 102 12/16/2024
3.0.23 108 12/10/2024
3.0.22 107 12/10/2024
3.0.21 104 12/10/2024
3.0.20 113 12/9/2024
3.0.19 104 12/9/2024
3.0.18 105 12/9/2024
3.0.17 108 12/9/2024
3.0.16 111 12/7/2024
3.0.15 125 12/6/2024
3.0.14 100 12/6/2024
3.0.13 108 12/6/2024
3.0.12 108 12/6/2024
3.0.11 126 12/6/2024
3.0.10 112 12/6/2024
3.0.9 112 12/6/2024
3.0.8 115 12/6/2024
3.0.7 115 12/6/2024
3.0.6 115 12/6/2024
3.0.5 109 12/6/2024
3.0.4 113 12/6/2024
3.0.3 101 12/5/2024
3.0.2 107 12/5/2024
3.0.1 110 12/4/2024