I'm looking for a diff algorithm that will produce results like SO's edit revisions page. I've more or less just started looking and I'm not opposed to doing it myself but I don't need to reinvent the wheel.
I'll be using C# 4.0. I'll basically have two strings, and old one and a new one. I want to know what has changed in the new one by highlighting and strike throughs.
Its based on Longest common subsequence
algorithm, popularly known as LCS
.
LCS of old text and new text gives the part that has remain unchanged. So the parts of old text that is not part of LCS is the one that got changed.
From the wiki page above:
It is a classic computer science problem, the basis of diff (a file comparison program that outputs the differences between two files), and has applications in bioinformatics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With