ndiff 1.5.0
dotnet add package ndiff --version 1.5.0
NuGet\Install-Package ndiff -Version 1.5.0
<PackageReference Include="ndiff" Version="1.5.0" />
paket add ndiff --version 1.5.0
#r "nuget: ndiff, 1.5.0"
// Install ndiff as a Cake Addin #addin nuget:?package=ndiff&version=1.5.0 // Install ndiff as a Cake Tool #tool nuget:?package=ndiff&version=1.5.0
NDiff
A sequence comparison library for any object.
Description
A C# implementation of the Longest Common Subsequence algorithm for both text and objects.
The code is adapted from the original code at Mathertel.
The original code provided an algorithm implementation for strings. NDiff extends this to handle all types. If the type being compared does not implement IEquatable<T>
, then an IEqualityComparer<T>
should be provided.
Runtime Environment
The project is built against under .NET Standard 2.0, 2.1 and .NET 6.0.
Using the Library
Comparison operations are implemented as extension methods on either strings or enumerables (IEnumerable<T>
). Calling the Diff
extension method will produce a set of DiffEntry
objects describing all differences between the compared sequences.
Using the Format
extension method will provide a list of Compared<T>
. This list gives all items in the source list and other list and marks them with the ChangeAction
for that item. This lets you generate a list of deletions and insertions for any item type.
Similar formatting options are provided for strings, using the DiffFormat
extension methods.
For the moment, please refer to the tests for usage examples. There are tests for both text and object sequences.
Reporting Issues and Bugs
When reporting issues and bugs, please provide a clear set of steps to reproduce the issue. The best way is to provide a failing test case as a pull request.
If that is not possible, please provide a set of steps which allow the bug to be reliably reproduced. These steps must also reproduce the issue on a computer that is not your own.
Contributions
All contributions are appreciated. Please provide them as an issue with an accompanying pull request.
This is an open source project. Work has gone into the project it was forked from, as well as the later improvements. Please respect the license terms and the fact that issues and contributions may not be handled as fast as you may wish. The best way to get your contribution adopted is to make it easy to pull into the code base.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
-
net7.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.