0

I'm looking for a free library that can take two strings and produce a diff much like the diff's you see on edit revisions here on SO.

I'm hoping one exists, as this is a trivial part of an app I'm working on and I'd hate to waste time reinventing the wheel.

Any suggestions?

FlySwat
  • 172,459
  • 74
  • 246
  • 311

3 Answers3

2

I just released my DiffPlex project which does exactly what you ask.

Matthew Manela
  • 16,572
  • 3
  • 64
  • 66
1

You can do an MD5 hash of both files to determine if they are identical. The SO-style revision history would be a bit more intensive.

Check out the source code for this diff tool, which might get you going in the right direction.

http://dotnet.jku.at/applications/Diff/Src.aspx

Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
1

Surprisingly, i found one implementation which could give you the same functionality as SO edits. codeproject I am going to use it as well and hope this helps other people too.

Vikram
  • 6,865
  • 9
  • 50
  • 61
  • just tested it and it works great ! i had searched for an article on this no. of times but could never find anything useful. surprisingly i found the most useful one today ! – Vikram May 04 '09 at 18:02