Soenneker.Utils.Strings.LevenshteinDistance 3.0.24

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.24
                    
NuGet\Install-Package Soenneker.Utils.Strings.LevenshteinDistance -Version 3.0.24
                    
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.24" />
                    
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.24" />
                    
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.24
                    
#r "nuget: Soenneker.Utils.Strings.LevenshteinDistance, 3.0.24"
                    
#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.
#:package Soenneker.Utils.Strings.LevenshteinDistance@3.0.24
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Utils.Strings.LevenshteinDistance&version=3.0.24
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Strings.LevenshteinDistance&version=3.0.24
                    
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.307 42 9/3/2025
3.0.306 122 8/11/2025
3.0.305 100 6/27/2025
3.0.304 154 5/27/2025
3.0.303 157 5/22/2025
3.0.302 153 5/7/2025
3.0.301 153 5/5/2025
3.0.300 153 5/5/2025
3.0.299 155 5/5/2025
3.0.298 166 4/8/2025
3.0.297 161 4/8/2025
3.0.296 162 4/8/2025
3.0.295 166 4/8/2025
3.0.294 161 4/8/2025
3.0.293 171 4/8/2025
3.0.292 170 4/7/2025
3.0.291 166 4/7/2025
3.0.290 157 4/7/2025
3.0.289 165 4/7/2025
3.0.288 166 4/7/2025
3.0.287 172 4/7/2025
3.0.286 170 4/7/2025
3.0.285 174 4/7/2025
3.0.284 168 4/6/2025
3.0.283 168 4/6/2025
3.0.282 140 4/6/2025
3.0.281 158 4/6/2025
3.0.280 119 4/6/2025
3.0.279 120 4/6/2025
3.0.278 116 4/5/2025
3.0.277 88 4/5/2025
3.0.276 100 4/5/2025
3.0.275 93 4/5/2025
3.0.274 99 4/5/2025
3.0.273 103 4/5/2025
3.0.272 99 4/5/2025
3.0.271 113 4/4/2025
3.0.270 165 4/4/2025
3.0.269 155 4/1/2025
3.0.268 145 3/31/2025
3.0.267 163 3/31/2025
3.0.266 92 3/29/2025
3.0.265 473 3/25/2025
3.0.264 482 3/25/2025
3.0.263 133 3/21/2025
3.0.262 153 3/18/2025
3.0.261 157 3/18/2025
3.0.260 85 3/15/2025
3.0.259 78 3/15/2025
3.0.258 72 3/15/2025
3.0.257 172 3/12/2025
3.0.256 166 3/12/2025
3.0.255 171 3/12/2025
3.0.254 182 3/11/2025
3.0.253 171 3/11/2025
3.0.252 176 3/11/2025
3.0.251 177 3/11/2025
3.0.250 170 3/11/2025
3.0.249 238 3/7/2025
3.0.248 224 3/7/2025
3.0.247 100 3/2/2025
3.0.246 105 3/2/2025
3.0.245 112 3/2/2025
3.0.244 109 3/2/2025
3.0.243 110 3/2/2025
3.0.242 105 3/1/2025
3.0.241 113 3/1/2025
3.0.240 94 3/1/2025
3.0.239 98 3/1/2025
3.0.238 111 3/1/2025
3.0.237 109 2/25/2025
3.0.236 115 2/25/2025
3.0.235 113 2/25/2025
3.0.234 100 2/25/2025
3.0.233 110 2/24/2025
3.0.232 114 2/23/2025
3.0.231 105 2/23/2025
3.0.230 115 2/22/2025
3.0.229 107 2/22/2025
3.0.228 107 2/22/2025
3.0.227 119 2/22/2025
3.0.226 99 2/22/2025
3.0.225 109 2/22/2025
3.0.224 107 2/21/2025
3.0.223 117 2/21/2025
3.0.222 114 2/19/2025
3.0.221 112 2/19/2025
3.0.220 111 2/19/2025
3.0.219 112 2/19/2025
3.0.218 120 2/18/2025
3.0.217 112 2/18/2025
3.0.216 116 2/18/2025
3.0.215 116 2/14/2025
3.0.214 123 2/14/2025
3.0.213 121 2/13/2025
3.0.212 115 2/12/2025
3.0.211 119 2/12/2025
3.0.210 118 2/12/2025
3.0.209 124 2/12/2025
3.0.208 113 2/12/2025
3.0.207 116 2/11/2025
3.0.206 122 2/11/2025
3.0.205 122 2/11/2025
3.0.204 119 2/11/2025
3.0.203 111 2/11/2025
3.0.202 116 2/10/2025
3.0.201 126 2/10/2025
3.0.200 131 2/10/2025
3.0.199 123 2/10/2025
3.0.198 112 2/10/2025
3.0.197 128 2/9/2025
3.0.196 113 2/8/2025
3.0.195 104 2/8/2025
3.0.194 108 2/8/2025
3.0.193 108 2/8/2025
3.0.192 102 2/8/2025
3.0.191 109 2/7/2025
3.0.190 104 2/7/2025
3.0.189 118 2/7/2025
3.0.188 113 2/7/2025
3.0.187 116 2/7/2025
3.0.186 116 2/7/2025
3.0.185 113 2/7/2025
3.0.184 107 2/7/2025
3.0.183 102 2/6/2025
3.0.182 107 2/5/2025
3.0.181 112 2/5/2025
3.0.180 111 2/5/2025
3.0.179 110 2/5/2025
3.0.178 105 2/5/2025
3.0.177 105 2/5/2025
3.0.176 123 2/5/2025
3.0.175 113 1/28/2025
3.0.174 102 1/28/2025
3.0.173 106 1/28/2025
3.0.172 105 1/28/2025
3.0.171 94 1/27/2025
3.0.170 104 1/27/2025
3.0.169 103 1/26/2025
3.0.168 101 1/26/2025
3.0.167 104 1/26/2025
3.0.166 100 1/25/2025
3.0.165 111 1/25/2025
3.0.164 112 1/25/2025
3.0.163 110 1/25/2025
3.0.162 104 1/25/2025
3.0.161 101 1/25/2025
3.0.160 96 1/24/2025
3.0.159 92 1/24/2025
3.0.158 100 1/24/2025
3.0.157 105 1/24/2025
3.0.156 111 1/24/2025
3.0.155 99 1/23/2025
3.0.154 116 1/23/2025
3.0.153 109 1/21/2025
3.0.152 96 1/21/2025
3.0.151 106 1/21/2025
3.0.150 112 1/21/2025
3.0.149 120 1/21/2025
3.0.148 110 1/21/2025
3.0.147 118 1/21/2025
3.0.146 107 1/20/2025
3.0.145 92 1/20/2025
3.0.144 109 1/20/2025
3.0.143 103 1/20/2025
3.0.142 119 1/20/2025
3.0.141 110 1/20/2025
3.0.140 95 1/19/2025
3.0.139 102 1/19/2025
3.0.138 99 1/19/2025
3.0.137 106 1/19/2025
3.0.136 100 1/19/2025
3.0.135 99 1/19/2025
3.0.134 88 1/19/2025
3.0.133 107 1/18/2025
3.0.132 113 1/18/2025
3.0.131 99 1/18/2025
3.0.130 100 1/18/2025
3.0.129 102 1/17/2025
3.0.128 99 1/17/2025
3.0.127 102 1/17/2025
3.0.126 103 1/17/2025
3.0.125 98 1/17/2025
3.0.124 102 1/17/2025
3.0.123 101 1/16/2025
3.0.122 100 1/16/2025
3.0.121 90 1/16/2025
3.0.120 98 1/16/2025
3.0.119 101 1/16/2025
3.0.118 101 1/16/2025
3.0.117 107 1/15/2025
3.0.116 103 1/15/2025
3.0.115 98 1/15/2025
3.0.114 89 1/15/2025
3.0.113 79 1/15/2025
3.0.112 80 1/15/2025
3.0.111 81 1/15/2025
3.0.110 68 1/15/2025
3.0.109 80 1/14/2025
3.0.108 78 1/14/2025
3.0.107 79 1/14/2025
3.0.106 103 1/14/2025
3.0.105 93 1/13/2025
3.0.104 92 1/13/2025
3.0.103 95 1/12/2025
3.0.102 100 1/11/2025
3.0.101 117 1/11/2025
3.0.100 102 1/11/2025
3.0.99 104 1/10/2025
3.0.98 116 1/10/2025
3.0.97 104 1/10/2025
3.0.96 98 1/10/2025
3.0.95 128 1/3/2025
3.0.94 133 1/3/2025
3.0.93 113 1/3/2025
3.0.92 117 1/3/2025
3.0.91 118 1/2/2025
3.0.90 113 1/2/2025
3.0.89 120 1/2/2025
3.0.88 112 1/2/2025
3.0.87 122 1/1/2025
3.0.86 129 1/1/2025
3.0.85 112 1/1/2025
3.0.84 120 1/1/2025
3.0.83 120 1/1/2025
3.0.82 119 1/1/2025
3.0.81 118 12/31/2024
3.0.80 128 12/31/2024
3.0.79 131 12/31/2024
3.0.77 130 12/31/2024
3.0.76 145 12/31/2024
3.0.75 130 12/31/2024
3.0.74 113 12/31/2024
3.0.73 111 12/31/2024
3.0.72 118 12/31/2024
3.0.71 134 12/31/2024
3.0.70 115 12/31/2024
3.0.69 112 12/30/2024
3.0.68 115 12/28/2024
3.0.67 111 12/28/2024
3.0.66 116 12/27/2024
3.0.65 116 12/27/2024
3.0.64 108 12/24/2024
3.0.63 111 12/24/2024
3.0.62 106 12/24/2024
3.0.61 108 12/24/2024
3.0.60 108 12/24/2024
3.0.59 108 12/24/2024
3.0.58 103 12/24/2024
3.0.57 112 12/24/2024
3.0.56 116 12/24/2024
3.0.55 106 12/24/2024
3.0.54 103 12/23/2024
3.0.53 107 12/23/2024
3.0.52 110 12/23/2024
3.0.51 107 12/23/2024
3.0.50 115 12/23/2024
3.0.49 120 12/23/2024
3.0.48 111 12/22/2024
3.0.47 113 12/22/2024
3.0.46 137 12/22/2024
3.0.45 115 12/22/2024
3.0.44 113 12/22/2024
3.0.43 118 12/22/2024
3.0.42 113 12/22/2024
3.0.41 118 12/21/2024
3.0.40 120 12/21/2024
3.0.39 120 12/21/2024
3.0.38 124 12/21/2024
3.0.37 113 12/21/2024
3.0.36 107 12/21/2024
3.0.35 117 12/20/2024
3.0.34 119 12/20/2024
3.0.33 115 12/20/2024
3.0.32 113 12/20/2024
3.0.31 111 12/20/2024
3.0.30 120 12/19/2024
3.0.29 110 12/19/2024
3.0.28 108 12/19/2024
3.0.27 130 12/18/2024
3.0.26 116 12/18/2024
3.0.25 107 12/16/2024
3.0.24 113 12/16/2024
3.0.23 120 12/10/2024
3.0.22 121 12/10/2024
3.0.21 112 12/10/2024
3.0.20 124 12/9/2024
3.0.19 119 12/9/2024
3.0.18 117 12/9/2024
3.0.17 124 12/9/2024
3.0.16 128 12/7/2024
3.0.15 137 12/6/2024
3.0.14 114 12/6/2024
3.0.13 117 12/6/2024
3.0.12 119 12/6/2024
3.0.11 136 12/6/2024
3.0.10 127 12/6/2024
3.0.9 127 12/6/2024
3.0.8 126 12/6/2024
3.0.7 130 12/6/2024
3.0.6 124 12/6/2024
3.0.5 120 12/6/2024
3.0.4 127 12/6/2024
3.0.3 115 12/5/2024
3.0.2 123 12/5/2024
3.0.1 126 12/4/2024