C# Diff with Unified Diff Support, this codebase is a port from the popular JS library jsdiff by kpdecker.
- Clean-up code (Code smells and bugs according to Sonar)
- Patch
- Create
- Apply
- Merge
- Parse
- Diff
- Array
- Base
Diff() - Character
Diff() - CSS
- JSON
- Line
DiffLines() - Sentence
DiffSentence() - Word (Partial, issues with Regex in
DiffWord.Tokenize)
- Convert
DiffConvert- XML
DiffConvert.ToXml - DMP (diff-match-patch)
DiffConvert.ToDmp
- XML
using CSharpDiff.Diff;
var diff = new Diff(new DiffOptions
{
IgnoreCase = true
});
var result = diff.diff("New Value.", "New value.");using CSharpDiff.Diff;
var text1 = "Here im.\nRock you like old man.\nYeah";
var text2 = "Here im.\nRock you like hurricane.\nYeah";
var diff = new DiffLines();
var difference = diff.diff(text1, text2);using CSharpDiff.Diff;
var text1 = "Here im. Rock you like old man.";
var text2 = "Here im. Rock you like hurricane.";
var diff = new DiffSentence();
var difference = diff.diff(text1, text2);using CSharpDiff.Patch;
var text1 = "...";
var text2 = "...";
var ps = new Patch();
string patch = ps.create("filename1", "filename2", text1, text2, "header1", "header2", new PatchOptions());Idk, just make a pull request.