views:

133

answers:

3

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?

+1  A: 

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
+1  A: 

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
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
+1  A: 

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

Matthew Manela